import ajax from "@/libs/Ajax";

let resolve = (NAME_SPACE, merge = {}) => {
    return {
        ...merge,
        doQuery: (params) => {
            return ajax.get(`${NAME_SPACE}/query`, {params: params});
        },
        doGet: uuid => {
            return ajax.get(`${NAME_SPACE}/get/${uuid}`);
        },
        doDelete: (uuid) => {
            return ajax.delete(`${NAME_SPACE}/delete/${uuid}`);
        },
        doSave: data => {
            return ajax.post(`${NAME_SPACE}/save`, data);
        },
        listAll: () => {
            return ajax.get(`${NAME_SPACE}/listAll`);
        },
    }
}

export default resolve




