import { TaskRemoteCfg, TaskRemoteCfgQueryParam } from '@/types'
import request from '@/until/request'

/**
 * 获取远程配置任务列表
 * @param data TaskRemoteCfgQueryParam
 */
const QueryTaskRemoteCfgList = (data: TaskRemoteCfgQueryParam) =>
    request({
        url: '/TaskRemoteCfgAction/list',
        method: 'post',
        data: data
    })

/**
* 新增远程配置任务
* @param data TaskRemoteCfg
*/
const AddTaskRemoteCfg = (data: TaskRemoteCfg) =>
    request({
        url: '/TaskRemoteCfgAction/saveTaskRemoteCfg',
        method: 'post',
        data: data
    })

/**
* 编辑远程配置任务
* @param data TaskRemoteCfg
*/
const EditTaskRemoteCfg = (data: TaskRemoteCfg) =>
    request({
        url: '/TaskRemoteCfgAction/updateTaskRemoteCfg',
        method: 'post',
        data: data
    })

/**
* 删除远程配置任务
* @param  id number
*/
const DeleteTaskRemoteCfg = (id: number) =>
    request({
        url: '/TaskRemoteCfgAction/deleteTaskRemoteCfg/' + id,
        method: 'get',
    })

export default {
    QueryTaskRemoteCfgList,
    AddTaskRemoteCfg,
    EditTaskRemoteCfg,
    DeleteTaskRemoteCfg
}