Blame view

src/api/sjsbTask.js 1.38 KB
任超 committed
1
import request from '@/utils/request'
任超 committed
2
import SERVER from './config'
任超 committed
3

任超 committed
4
class sjsbTask {
任超 committed
5 6 7 8
  // 定时任务
  // 定时任务查询接口
  async getTaskListByName (data) {
    return request({
赵千 committed
9 10 11 12 13 14 15
      url: SERVER.SERVERAPI + '/rest/schedule/getScheduleList',
      method: 'get',
      params: {
        jobName: data.jobName,
        pageNo: data.currentPage,
        pageSize: data.pageSize
      }
任超 committed
16 17 18 19 20
    })
  }
  // 定时任务新增接口
  async sjsbTaskSave (data) {
    return request({
赵千 committed
21
      url: SERVER.SERVERAPI + '/rest/schedule/add',
任超 committed
22 23 24 25 26 27 28
      method: 'post',
      data
    })
  }
  // 修改定时任务执行时间接口
  async updateCron (data) {
    return request({
赵千 committed
29
      url: SERVER.SERVERAPI + '/rest/schedule/update',
任超 committed
30 31 32 33 34 35 36
      method: 'post',
      data
    })
  }
  // 定时任务删除接口
  async sjsbTaskRemove (id) {
    return request({
赵千 committed
37
      url: SERVER.SERVERAPI + '/rest/schedule/delete',
任超 committed
38 39
      method: 'get',
      params: {
赵千 committed
40
        jobId: id
任超 committed
41 42 43 44
      }
    })
  }
  // 恢复任务接口
赵千 committed
45
  async recover (id) {
任超 committed
46
    return request({
赵千 committed
47
      url: SERVER.SERVERAPI + '/rest/schedule/recover',
任超 committed
48 49
      method: 'get',
      params: {
赵千 committed
50
        jobId: id
任超 committed
51 52 53 54
      }
    })
  }
  // 激活任务接口
赵千 committed
55
  async active (id) {
任超 committed
56
    return request({
赵千 committed
57
      url: SERVER.SERVERAPI + '/rest/schedule/active',
任超 committed
58 59
      method: 'get',
      params: {
赵千 committed
60
        jobId: id
任超 committed
61 62 63 64
      }
    })
  }
}
赵千 committed
65
export default new sjsbTask()