data/ts.sql | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/aspect/LogAspect.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/lf/server/controller/all/SignController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
data/ts.sql
@@ -128,11 +128,13 @@ select * from bd.b_hydrogeology_attach limit 1; select * from bd.b_pac_hydrogeology limit 1; select * from lf.sys_serve_log; select * from lf.sys_meta; select * from lf.sys_operate order by id limit 20; select modular1,modular2,count(*) from lf.sys_operate group by modular1,modular2 order by modular1 desc,modular2; select type from lf.sys_operate group by type src/main/java/com/lf/server/aspect/LogAspect.java
@@ -33,19 +33,19 @@ @Autowired private OperateService operateService; private final static String SELECT = "/select"; private final static String SELECT = "select"; private final static String INSERT = "/insert"; private final static String INSERT = "insert"; private final static String UPDATE = "/update"; private final static String UPDATE = "update"; private final static String DELETE = "/delete"; private final static String DELETE = "delete"; private final static String UPLOAD = "/upload"; private final static String UPLOAD = "upload"; private final static String DOWNLOAD = "/download"; private final static String DOWNLOAD = "download"; private final static String COUNT = "/count"; private final static String COUNT = "count"; private final static String SPLIT = "\\\\"; src/main/java/com/lf/server/controller/all/SignController.java
@@ -6,11 +6,13 @@ import com.lf.server.entity.all.SettingData; import com.lf.server.entity.all.StaticData; import com.lf.server.entity.sys.LoginEntity; import com.lf.server.entity.sys.OperateEntity; import com.lf.server.entity.sys.TokenEntity; import com.lf.server.entity.sys.UserEntity; import com.lf.server.helper.*; import com.lf.server.service.all.ScheduleService; import com.lf.server.service.sys.LoginService; import com.lf.server.service.sys.OperateService; import com.lf.server.service.sys.TokenService; import com.lf.server.service.sys.UserService; import com.lf.server.service.all.SignService; @@ -45,6 +47,9 @@ @Autowired SignService signService; @Autowired private OperateService operateService; @Autowired PropertiesConfig propertiesConfig; @@ -226,4 +231,31 @@ return fail(ex.getMessage(), null); } } @ApiOperation(value = "插入操作日志") @GetMapping("/insertOpLog") public ResponseMsg<Object> insertOpLog(String m1, String m2, HttpServletRequest req) { try { if (StringHelper.isEmpty(m1)) { return fail("一级模块必填", 0); } OperateEntity oe = new OperateEntity(); oe.setIp(WebHelper.getIpAddress(req)); oe.setModular1(m1); oe.setModular2(m2); oe.setType(0); UserEntity ue = tokenService.getCurrentUser(req); if (ue != null) { oe.setUserid(ue.getId()); } int rows = operateService.insertOperate(oe); return success(rows); } catch (Exception ex) { return fail(ex.getMessage(), 0); } } }