zjk
2026-07-31 dc2872d6d346a7de629b3b0686057ab54f216f09
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.ruoyi.web.controller.api;
 
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.query.SysOperLogQuery;
import com.ruoyi.system.service.ISysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 操作日志接口
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/system/operation/log")
public class SysOperationLogController extends BaseController
{
    private static final int EXPORT_PAGE_SIZE = 10000;
 
    @Autowired
    private ISysOperLogService operLogService;
 
    /**
     * 分页查询操作日志
     */
    @PreAuthorize("@ss.hasPermi('visitor:operation-log:view')")
    @PostMapping("/page")
    public AjaxResult page(@RequestBody(required = false) SysOperLogQuery request)
    {
        return success(operLogService.selectOperLogPageList(request == null ? new SysOperLogQuery() : request));
    }
 
    /**
     * 导出操作日志
     */
    @Log(title = "操作日志", businessType = BusinessType.EXPORT)
    @PreAuthorize("@ss.hasPermi('visitor:operation-log:export')")
    @PostMapping("/export")
    public AjaxResult export(@RequestBody(required = false) SysOperLogQuery request)
    {
        SysOperLogQuery query = request == null ? new SysOperLogQuery() : request;
        query.setPageNum(1);
        query.setPageSize(EXPORT_PAGE_SIZE);
        return success(operLogService.selectOperLogPageList(query).getRecords());
    }
}