import config from "@/config";
import http from "@/utils/request";

export default {
    list: {
        url: `${config.API_URL}/cutter/task/list`,
        name: "任务列表",
        get: async function(params = {}){
            return await http.get(this.url, params);
        }
    },
    save: {
        url: `${config.API_URL}/cutter/task/save`,
        name: "任务新增/编辑",
        post: async function(data = {}){
            return await http.post(this.url, data);
        }
    },
    del: {
        url: `${config.API_URL}/cutter/task/del`,
        name: "任务删除",
        delete: async function(id){
            return await http.delete(`${this.url}/${id}`);
        }
    },
    setStatus: {
        url: `${config.API_URL}/cutter/task/set_status`,
        name: "任务状态设置",
        get: async function(id, status){
            return await http.get(`${this.url}/${id}/${status}`);
        }
    },
    info: {
        url: `${config.API_URL}/cutter/task/info`,
        name: "任务详情",
        get: async function(id){
            return await http.get(`${this.url}/${id}`);
        }
    }
}
