import { WeaTools } from "ecCom";

// ./api/integration/web/Schedule?methed=?

// methed:
// 根据标识(即id) 删除计划任务:getDelateScheduleById
// 查询计划任务:getFindSchedule
// 检查 用户及计划任务类:doCheckSchedule
// 批量删除计划任务:getBatchDel
// 编辑计划任务:doEditSchedule
// 添加计划任务:doAddSchedule

const API = {
  getFormRightMenus: params =>
    WeaTools.callApi(
      "/api/integration/schedule/getFormRightMenus",
      "POST",
      params
    ),
  getListRightMenus: params =>
    WeaTools.callApi(
      "/api/integration/schedule/getListRightMenus",
      "POST",
      params
    ),
  getList: params =>
    WeaTools.callApi("/api/integration/schedule/getList", "POST", params),
  getListConditions: params =>
    WeaTools.callApi(
      "/api/integration/schedule/getListConditions",
      "POST",
      params
    ),
  getForm: params =>
    WeaTools.callApi("/api/integration/schedule/getForm", "POST", params),
  insert: params =>
    WeaTools.callApi("/api/integration/schedule/insert", "POST", params, "json", true),
  update: params =>
    WeaTools.callApi("/api/integration/schedule/update", "POST", params),
  delete: params =>
    WeaTools.callApi("/api/integration/schedule/delete", "POST", params),
  batchDelete: params =>
    WeaTools.callApi("/api/integration/schedule/batchDelete", "POST", params),
  getListConditions: params =>
    WeaTools.callApi("/api/integration/schedule/getListConditions", "POST", params),
  // 系统日志
  getSelectLog: params =>
    WeaTools.callApi("/api/integration/schedule/getSelectLog", "POST", params),
  // 运行日志
  doRunLog: params =>
    WeaTools.callApi("/api/integration/schedule/doRunLog", "POST", params),
  // 运行日志 search advance
  getLogListConditions: params =>
    WeaTools.callApi("/api/integration/schedule/getLogListConditions", "POST", params),
  // 系统日志
  getSysLog: params =>
    WeaTools.callApi("/api/common/log/viewexp", "POST", params),
  getdata: params =>
    WeaTools.callApi("/api/common/log/getdata", "GET", params),
  trans: params =>
    WeaTools.callApi("/api/common/log/audit/trans", "GET", params),
  getSysLogConditions: params =>
    WeaTools.callApi("/api/common/log/view", "POST", params),
  // 运行
  start: params =>
    WeaTools.callApi("/api/integration/schedule/start", "POST", params),
  // 禁止
  stop: params =>
    WeaTools.callApi("/api/integration/schedule/stop", "POST", params),
  // 禁止
  pause: params =>
    WeaTools.callApi("/api/integration/schedule/pause", "POST", params),
  // 禁止
  resume: params =>
    WeaTools.callApi("/api/integration/schedule/resume", "POST", params),
  getTriggerList: params =>
    WeaTools.callApi("/api/integration/schedule/triggerList", "POST", params),
	getScheduleRunLogCondition: params =>
    WeaTools.callApi("/api/integration/schedule/getScheduleRunLogCondition", "POST", params),
	getScheduleMonitorCondition: params =>
    WeaTools.callApi("/api/integration/schedule/getScheduleMonitorCondition", "POST", params),
  getScheduleSysLogCondition: params => 
    WeaTools.callApi("/api/integration/schedule/getScheduleSysLogCondition", "POST", params),
  immediatelyRun: params => 
    WeaTools.callApi("/api/integration/schedule/immediatelyRun", "POST", params),
  test: params => 
    WeaTools.callApi("/api/integration/schedule/test", "POST", params),
  viewDetail: params =>
    WeaTools.callApi("/api/common/log/viewdetail", 'GET', params)
};

export default API;
