| | |
| | | package com.lf.server.aspect; |
| | | |
| | | import com.lf.server.entity.sys.OperateEntity; |
| | | import com.lf.server.entity.sys.UsersEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.sys.OperateService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | private final static String UPLOAD = "upload"; |
| | | |
| | | private final static String DOWNLOAD = "download"; |
| | | |
| | | private final static String SPLIT = "\\"; |
| | | |
| | | private static final Log log = LogFactory.getLog(LogAspect.class); |
| | | |
| | |
| | | // 设置模块 |
| | | Api api = clazz.getAnnotation(Api.class); |
| | | if (api != null) { |
| | | oe.setModular(api.tags()[0]); |
| | | String[] strs = api.tags()[0].split(SPLIT); |
| | | oe.setModular1(strs[0]); |
| | | oe.setModular1(strs[1]); |
| | | } |
| | | |
| | | // 设置类名\方法名、类别 |
| | |
| | | oe.setBak(sysLog.value()); |
| | | } |
| | | |
| | | UsersEntity ue = tokenService.getCurrentUser(req); |
| | | UserEntity ue = tokenService.getCurrentUser(req); |
| | | if (ue != null) { |
| | | oe.setUserid(ue.getId()); |
| | | } |
| | | |
| | | operateService.insertOperate(oe); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getStackTrace()); |
| | | log.error(ex.getMessage() + ex.getStackTrace() + "\n"); |
| | | } |
| | | } |
| | | |