inleft
2022-02-09 9bcb19959eeb9da9bde2561e7278f6d0a55eb151
commit | author | age
9bcb19 1 /*
I 2 Copyright [2020] [https://www.xiaonuo.vip]
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 Snowy采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点:
17
18 1.请不要删除和修改根目录下的LICENSE文件。
19 2.请不要删除和修改Snowy源码头部的版权声明。
20 3.请保留源码和相关描述文件的项目出处,作者声明等。
21 4.分发源码时候,请注明软件出处 https://gitee.com/xiaonuobase/snowy
22 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/xiaonuobase/snowy
23 6.若您的项目无法满足以上几点,可申请商业授权,获取Snowy商业授权许可,请在官网购买授权,地址为 https://www.xiaonuo.vip
24  */
25 package vip.xiaonuo.sys.modular.log.controller;
26
27 import org.springframework.web.bind.annotation.GetMapping;
28 import org.springframework.web.bind.annotation.PostMapping;
29 import org.springframework.web.bind.annotation.RestController;
30 import vip.xiaonuo.core.annotion.BusinessLog;
31 import vip.xiaonuo.core.annotion.Permission;
32 import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
33 import vip.xiaonuo.core.pojo.response.ResponseData;
34 import vip.xiaonuo.core.pojo.response.SuccessResponseData;
35 import vip.xiaonuo.sys.modular.log.param.SysOpLogParam;
36 import vip.xiaonuo.sys.modular.log.param.SysVisLogParam;
37 import vip.xiaonuo.sys.modular.log.service.SysOpLogService;
38 import vip.xiaonuo.sys.modular.log.service.SysVisLogService;
39
40 import javax.annotation.Resource;
41
42 /**
43  * 系统日志控制器
44  *
45  * @author xuyuxiang
46  * @date 2020/3/19 21:14
47  */
48 @RestController
49 public class SysLogController {
50
51     @Resource
52     private SysVisLogService sysVisLogService;
53
54     @Resource
55     private SysOpLogService sysOpLogService;
56
57     /**
58      * 查询访问日志
59      *
60      * @author xuyuxiang
61      * @date 2020/3/20 18:52
62      */
63     @Permission
64     @GetMapping("/sysVisLog/page")
65     public ResponseData visLogPage(SysVisLogParam visLogParam) {
66         return new SuccessResponseData(sysVisLogService.page(visLogParam));
67     }
68
69     /**
70      * 查询操作日志
71      *
72      * @author xuyuxiang
73      * @date 2020/3/20 18:52
74      */
75     @Permission
76     @GetMapping("/sysOpLog/page")
77     public ResponseData opLogPage(SysOpLogParam sysOpLogParam) {
78         return new SuccessResponseData(sysOpLogService.page(sysOpLogParam));
79     }
80
81     /**
82      * 清空访问日志
83      *
84      * @author xuyuxiang
85      * @date 2020/3/23 16:28
86      */
87     @Permission
88     @PostMapping("/sysVisLog/delete")
89     @BusinessLog(title = "访问日志_清空", opType = LogAnnotionOpTypeEnum.CLEAN)
90     public ResponseData visLogDelete() {
91         sysVisLogService.delete();
92         return new SuccessResponseData();
93     }
94
95     /**
96      * 清空操作日志
97      *
98      * @author xuyuxiang
99      * @date 2020/3/23 16:28
100      */
101     @Permission
102     @PostMapping("/sysOpLog/delete")
103     @BusinessLog(title = "操作日志_清空", opType = LogAnnotionOpTypeEnum.CLEAN)
104     public ResponseData opLogDelete() {
105         sysOpLogService.delete();
106         return new SuccessResponseData();
107     }
108
109     /**
110      * 导出系统操作日志
111      *
112      * @author yubaoshan
113      * @date 2020/5/30 17:55
114      */
115     @Permission
116     @GetMapping("/sysOpLog/export")
117     @BusinessLog(title = "操作日志_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
118     public void export(SysOpLogParam sysOpLogParam) {
119         sysOpLogService.export(sysOpLogParam);
120     }
121
122     /**
123      * 导出系统访问日志
124      *
125      * @author yubaoshan
126      * @date 2020/5/30 17:55
127      */
128     @Permission
129     @GetMapping("/sysVisLog/export")
130     @BusinessLog(title = "访问日志_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
131     public void export(SysVisLogParam sysVisLogParam) {
132         sysVisLogService.export(sysVisLogParam);
133     }
134
135 }