PoOperLogController.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. package com.ruoyi.web.controller.system;
  2. import com.ruoyi.common.annotation.Log;
  3. import com.ruoyi.common.core.controller.BaseController;
  4. import com.ruoyi.common.core.domain.AjaxResult;
  5. import com.ruoyi.common.core.page.TableDataInfo;
  6. import com.ruoyi.common.enums.BusinessType;
  7. import com.ruoyi.common.utils.poi.ExcelUtil;
  8. import com.ruoyi.system.domain.PoOperLog;
  9. import com.ruoyi.system.service.IPoOperLogService;
  10. import io.swagger.annotations.ApiOperation;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.security.access.prepost.PreAuthorize;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.servlet.http.HttpServletResponse;
  15. import java.util.List;
  16. /**
  17. * 操作日志记录Controller
  18. * @date 2023-01-15
  19. */
  20. @RestController
  21. @RequestMapping("/post/operlog")
  22. public class PoOperLogController extends BaseController
  23. {
  24. @Autowired
  25. private IPoOperLogService poOperLogService;
  26. /**
  27. * 查询操作日志记录列表
  28. */
  29. @ApiOperation("查询操作日志记录列表")
  30. @PreAuthorize("@ss.hasPermi('post:operlog:list')")
  31. @GetMapping("/list")
  32. public TableDataInfo list(PoOperLog poOperLog)
  33. {
  34. startPage();
  35. List<PoOperLog> list = poOperLogService.selectPoOperLogList(poOperLog);
  36. return getDataTable(list);
  37. }
  38. /**
  39. * 导出操作日志记录列表
  40. */
  41. @ApiOperation("导出日志列表")
  42. @PreAuthorize("@ss.hasPermi('post:operlog:export')")
  43. @Log(title = "操作日志记录", businessType = BusinessType.EXPORT)
  44. @PostMapping("/export")
  45. public void export(HttpServletResponse response, PoOperLog poOperLog)
  46. {
  47. List<PoOperLog> list = poOperLogService.selectPoOperLogList(poOperLog);
  48. ExcelUtil<PoOperLog> util = new ExcelUtil<PoOperLog>(PoOperLog.class);
  49. util.exportExcel(response, list, "操作日志记录数据");
  50. }
  51. /**
  52. * 获取操作日志记录详细信息
  53. */
  54. @ApiOperation("获取操作日志详细信息")
  55. @PreAuthorize("@ss.hasPermi('post:operlog:query')")
  56. @GetMapping(value = "/{operId}")
  57. public AjaxResult getInfo(@PathVariable("operId") Long operId)
  58. {
  59. return success(poOperLogService.selectPoOperLogByOperId(operId));
  60. }
  61. /**
  62. * 新增操作日志记录
  63. */
  64. @ApiOperation("新增操作日志")
  65. @PreAuthorize("@ss.hasPermi('post:operlog:add')")
  66. @Log(title = "操作日志记录", businessType = BusinessType.INSERT)
  67. @PostMapping("/add")
  68. public AjaxResult add(@RequestBody PoOperLog poOperLog)
  69. {
  70. return toAjax(poOperLogService.insertPoOperLog(poOperLog));
  71. }
  72. /**
  73. * 修改操作日志记录
  74. */
  75. @ApiOperation("修改操作日志")
  76. @PreAuthorize("@ss.hasPermi('post:operlog:edit')")
  77. @Log(title = "操作日志记录", businessType = BusinessType.UPDATE)
  78. @PutMapping("/edit")
  79. public AjaxResult edit(@RequestBody PoOperLog poOperLog)
  80. {
  81. return toAjax(poOperLogService.updatePoOperLog(poOperLog));
  82. }
  83. /**
  84. * 删除操作日志记录
  85. */
  86. @ApiOperation("删除操作日志")
  87. @PreAuthorize("@ss.hasPermi('post:operlog:remove')")
  88. @Log(title = "操作日志记录", businessType = BusinessType.DELETE)
  89. @DeleteMapping("/remove/{operIds}")
  90. public AjaxResult remove(@PathVariable Long[] operIds)
  91. {
  92. return toAjax(poOperLogService.deletePoOperLogByOperIds(operIds));
  93. }
  94. }