import request from "@/utils/request";
//获取算子列表
const list = (data) => {
    return request({
        url: `/operators`,
        method: "get",
        params: data
    });
}
//新增算子
const add = (data) => {
    return request({
        url: `/operators`,
        method: "post",
        data: data
    });
}
//获取算子程序列表
const getPrograms = (data) => {
    return request({
        url: `/operators/programs`,
        method: "get",
        params: data
    });
}
//新增算子程序文件
const addPrograms = (data) => {
    return request({
        url: `/operators/programs`,
        method: "post",
        data: data
    });
}
//删除算子程序文件
const deletePrograms = (id) => {
    return request({
        url: `/operators/programs/${id}`,
        method: "delete"
    });
}
//删除算子
const deleteOperator = (id) => {
    return request({
        url: `/operators/${id}`,
        method: "delete"
    });
}
//获取算子详情
const findOne = (id) => {
    return request({
        url: `/operators/${id}`,
        method: "get"
    });
}



//获取算子详情
const uploadProgramsFile = (data) => {
    return request({
        url: `/operators/programs/upload`,
        method: "post"
    });
}


export default {
    list,
    add,
    getPrograms,
    addPrograms,
    deletePrograms,
    deleteOperator,
    findOne,
    uploadProgramsFile,
    
}