import http from "@/http/http";
import { ScheduleSettingDto, ScheduleSettingParam, ScheduleSettingId, ScheduleSettingStatus } from "./apiScheduleSettingModel";

enum Api {
    ScheduleSetting = '/api/ScheduleSetting/list',//任务查询
    add = '/api/ScheduleSetting/add',//任务添加
    edit = '/api/ScheduleSetting/edit',//任务编辑
    delete = '/api/ScheduleSetting',//任务删除
    changeState = '/api/ScheduleSetting/changeStatus',//任务停用、启用
}

//任务查询
export const api_ScheduleSettingList = async (parms: ScheduleSettingParam) => {
    return await http.post(Api.ScheduleSetting, parms)
}

//任务添加
export const api_ScheduleSettingAdd = async (parms: ScheduleSettingDto) => {
    return await http.post(Api.add, parms)
}

//任务编辑
export const api_ScheduleSettingEdit = async (parms: ScheduleSettingDto) => {
    return await http.post(Api.edit, parms)
}

//任务删除
export const api_ScheduleSettingDelete = async (parms: ScheduleSettingId) => {
    return await http.delete(Api.delete, parms)
}

/**
 * 任务停用、启用
 */
export const api_ScheduleSettingStatus = async (parms: ScheduleSettingStatus) => {
    return await http.post(Api.changeState, parms)
}