yyt
2024-06-26 0cceb649e1dc443c2a91d26d81eacb0867c96db3
提交 | 用户 | 时间
0cceb6 1 package com.jcdm.web.controller.monitor;
Y 2
3 import java.util.List;
4 import javax.servlet.http.HttpServletResponse;
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.security.access.prepost.PreAuthorize;
7 import org.springframework.web.bind.annotation.DeleteMapping;
8 import org.springframework.web.bind.annotation.GetMapping;
9 import org.springframework.web.bind.annotation.PathVariable;
10 import org.springframework.web.bind.annotation.PostMapping;
11 import org.springframework.web.bind.annotation.RequestMapping;
12 import org.springframework.web.bind.annotation.RestController;
13 import com.jcdm.common.annotation.Log;
14 import com.jcdm.common.core.controller.BaseController;
15 import com.jcdm.common.core.domain.AjaxResult;
16 import com.jcdm.common.core.page.TableDataInfo;
17 import com.jcdm.common.enums.BusinessType;
18 import com.jcdm.common.utils.poi.ExcelUtil;
19 import com.jcdm.system.domain.SysOperLog;
20 import com.jcdm.system.service.ISysOperLogService;
21
22 /**
23  * 操作日志记录
24  * 
25  * @author jc
26  */
27 @RestController
28 @RequestMapping("/monitor/operlog")
29 public class SysOperlogController extends BaseController
30 {
31     @Autowired
32     private ISysOperLogService operLogService;
33
34     @PreAuthorize("@ss.hasPermi('monitor:operlog:list')")
35     @GetMapping("/list")
36     public TableDataInfo list(SysOperLog operLog)
37     {
38         startPage();
39         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
40         return getDataTable(list);
41     }
42
43     @Log(title = "操作日志", businessType = BusinessType.EXPORT)
44     @PreAuthorize("@ss.hasPermi('monitor:operlog:export')")
45     @PostMapping("/export")
46     public void export(HttpServletResponse response, SysOperLog operLog)
47     {
48         List<SysOperLog> list = operLogService.selectOperLogList(operLog);
49         ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class);
50         util.exportExcel(response, list, "操作日志");
51     }
52
53     @Log(title = "操作日志", businessType = BusinessType.DELETE)
54     @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
55     @DeleteMapping("/{operIds}")
56     public AjaxResult remove(@PathVariable Long[] operIds)
57     {
58         return toAjax(operLogService.deleteOperLogByIds(operIds));
59     }
60
61     @Log(title = "操作日志", businessType = BusinessType.CLEAN)
62     @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')")
63     @DeleteMapping("/clean")
64     public AjaxResult clean()
65     {
66         operLogService.cleanOperLog();
67         return success();
68     }
69 }