PoOperLogController.java 3.1 KB

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