提交 | 用户 | 时间
|
516ef4
|
1 |
/** |
L |
2 |
* Copyright (c) 2018 人人开源 All rights reserved. |
|
3 |
* |
|
4 |
* https://www.renren.io |
|
5 |
* |
|
6 |
* 版权所有,侵权必究! |
|
7 |
*/ |
|
8 |
|
|
9 |
package com.iailab.module.shasteel.job.controller.admin; |
|
10 |
|
|
11 |
import com.iailab.framework.common.constant.Constant; |
|
12 |
import com.iailab.framework.common.page.PageData; |
|
13 |
import com.iailab.framework.common.pojo.CommonResult; |
|
14 |
import com.iailab.module.shasteel.job.dto.ScheduleJobLogDTO; |
|
15 |
import com.iailab.module.shasteel.job.service.ScheduleJobLogService; |
|
16 |
import io.swagger.v3.oas.annotations.Operation; |
|
17 |
import io.swagger.v3.oas.annotations.Parameter; |
|
18 |
import io.swagger.v3.oas.annotations.Parameters; |
|
19 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
20 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
21 |
import org.springframework.web.bind.annotation.*; |
|
22 |
|
|
23 |
import javax.annotation.Resource; |
|
24 |
import java.util.Map; |
|
25 |
|
|
26 |
/** |
|
27 |
* 定时任务日志 |
|
28 |
* |
|
29 |
* @author Mark sunlightcs@gmail.com |
|
30 |
*/ |
|
31 |
@RestController |
|
32 |
@RequestMapping("/sys/scheduleLog") |
|
33 |
@Tag(name = "定时任务日志") |
|
34 |
public class ScheduleJobLogController { |
|
35 |
@Resource |
|
36 |
private ScheduleJobLogService scheduleJobLogService; |
|
37 |
|
|
38 |
@GetMapping("page") |
|
39 |
@Operation(summary = "分页") |
|
40 |
@Parameters({ |
|
41 |
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , |
|
42 |
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , |
|
43 |
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , |
|
44 |
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") , |
|
45 |
@Parameter(name = "jobId", description = "jobId") |
|
46 |
}) |
|
47 |
@PreAuthorize("@ss.hasPermission('sys:schedule:log')") |
|
48 |
public CommonResult<PageData<ScheduleJobLogDTO>> page(@RequestParam Map<String, Object> params){ |
|
49 |
PageData<ScheduleJobLogDTO> page = scheduleJobLogService.page(params); |
|
50 |
|
|
51 |
return new CommonResult<PageData<ScheduleJobLogDTO>>().setData(page); |
|
52 |
} |
|
53 |
|
|
54 |
@GetMapping("{id}") |
|
55 |
@Operation(summary = "信息") |
|
56 |
@PreAuthorize("@ss.hasPermission('sys:schedule:log')") |
|
57 |
public CommonResult<ScheduleJobLogDTO> info(@PathVariable("id") Long id){ |
|
58 |
ScheduleJobLogDTO log = scheduleJobLogService.get(id); |
|
59 |
|
|
60 |
return new CommonResult<ScheduleJobLogDTO>().setData(log); |
|
61 |
} |
|
62 |
} |