SysJobLogController.java 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2021-2025, LXQ All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: LXQ (609827073@qq.com)
  16. */
  17. package com.kxs.daemon.quartz.controller;
  18. import cn.hutool.core.collection.CollUtil;
  19. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  20. import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
  21. import com.kxs.common.core.util.R;
  22. import com.kxs.daemon.quartz.entity.SysJobLog;
  23. import com.kxs.daemon.quartz.service.SysJobLogService;
  24. import io.swagger.v3.oas.annotations.Operation;
  25. import io.swagger.v3.oas.annotations.security.SecurityRequirement;
  26. import io.swagger.v3.oas.annotations.tags.Tag;
  27. import lombok.AllArgsConstructor;
  28. import org.springframework.http.HttpHeaders;
  29. import org.springframework.web.bind.annotation.*;
  30. /**
  31. * @author LXQ
  32. * <p>
  33. * 定时任务执行日志表
  34. */
  35. @RestController
  36. @AllArgsConstructor
  37. @RequestMapping("/sys-job-log")
  38. @Tag(description = "sys-job-log", name = "定时任务日志")
  39. @SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
  40. public class SysJobLogController {
  41. private final SysJobLogService sysJobLogService;
  42. /**
  43. * 分页查询
  44. * @param page 分页对象
  45. * @param sysJobLog 定时任务执行日志表
  46. * @return
  47. */
  48. @GetMapping("/page")
  49. @Operation(description = "分页定时任务日志查询")
  50. public R getSysJobLogPage(Page page, SysJobLog sysJobLog) {
  51. return R.ok(sysJobLogService.page(page, Wrappers.query(sysJobLog)));
  52. }
  53. @DeleteMapping
  54. @Operation(description = "批量删除日志")
  55. public R deleteLogs(@RequestBody Long[] ids) {
  56. return R.ok(sysJobLogService.removeBatchByIds(CollUtil.toList(ids)));
  57. }
  58. }