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
57
58
package io.hmit.modules.job.controller;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.Result;
import io.hmit.modules.job.dto.ScheduleJobLogDTO;
import io.hmit.modules.job.service.ScheduleJobLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
/**
* 定时任务日志
*
* @author zsh 408538940@qq.com
*/
@RestController
@RequestMapping("/sys/scheduleLog")
@Api(tags = "定时任务日志")
public class ScheduleJobLogController {
@Autowired
private ScheduleJobLogService scheduleJobLogService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "jobId", value = "jobId", paramType = "query", dataType = "String")
})
@RequiresPermissions("sys:schedule:log")
public Result<PageData<ScheduleJobLogDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<ScheduleJobLogDTO> page = scheduleJobLogService.page(params);
return new Result<PageData<ScheduleJobLogDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("sys:schedule:log")
public Result<ScheduleJobLogDTO> info(@PathVariable("id") Long id) {
ScheduleJobLogDTO log = scheduleJobLogService.get(id);
return new Result<ScheduleJobLogDTO>().ok(log);
}
}