ScheduleJobLogController.java
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.gxb.modules.job.controller;
import com.gxb.common.utils.PageUtils;
import com.gxb.common.utils.Query;
import com.gxb.common.utils.R;
import com.gxb.modules.job.entity.ScheduleJobLogEntity;
import com.gxb.modules.job.service.ScheduleJobLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 定时任务日志
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2016年12月1日 下午10:39:52
*/
@RestController
@RequestMapping("/sys/scheduleLog")
public class ScheduleJobLogController {
@Autowired
private ScheduleJobLogService scheduleJobLogService;
/**
* 定时任务日志列表
*/
@RequestMapping("/list")
@RequiresPermissions("sys:schedule:log")
public R list(@RequestParam Map<String, Object> params){
//查询列表数据
Query query = new Query(params);
List<ScheduleJobLogEntity> jobList = scheduleJobLogService.queryList(query);
int total = scheduleJobLogService.queryTotal(query);
PageUtils pageUtil = new PageUtils(jobList, total, query.getLimit(), query.getPage());
return R.ok().put("page", pageUtil);
}
/**
* 定时任务日志信息
*/
@RequestMapping("/info/{logId}")
public R info(@PathVariable("logId") Long logId){
ScheduleJobLogEntity log = scheduleJobLogService.queryObject(logId);
return R.ok().put("log", log);
}
}