sjsbTask.js 1.38 KB
import request from '@/utils/request'
import SERVER from './config'

class sjsbTask {
  // 定时任务
  // 定时任务查询接口
  async getTaskListByName (data) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/getScheduleList',
      method: 'get',
      params: {
        jobName: data.jobName,
        pageNo: data.currentPage,
        pageSize: data.pageSize
      }
    })
  }
  // 定时任务新增接口
  async sjsbTaskSave (data) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/add',
      method: 'post',
      data
    })
  }
  // 修改定时任务执行时间接口
  async updateCron (data) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/update',
      method: 'post',
      data
    })
  }
  // 定时任务删除接口
  async sjsbTaskRemove (id) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/delete',
      method: 'get',
      params: {
        jobId: id
      }
    })
  }
  // 恢复任务接口
  async recover (id) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/recover',
      method: 'get',
      params: {
        jobId: id
      }
    })
  }
  // 激活任务接口
  async active (id) {
    return request({
      url: SERVER.SERVERAPI + '/rest/schedule/active',
      method: 'get',
      params: {
        jobId: id
      }
    })
  }
}
export default new sjsbTask()