| | |
| | | package com.moon.server.aspect; |
| | | |
| | | import com.moon.server.annotation.SysLog; |
| | | import com.moon.server.entity.all.StaticData; |
| | | import com.moon.server.entity.sys.OperateEntity; |
| | | import com.moon.server.entity.sys.UserEntity; |
| | | import com.moon.server.helper.AsyncHelper; |
| | | import com.moon.server.helper.WebHelper; |
| | | import com.moon.server.service.sys.OperateService; |
| | | import com.moon.server.service.sys.TokenService; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.lang.reflect.Method; |
| | | import java.util.TimerTask; |
| | | |
| | | /** |
| | | * 日志切面类 |
| | |
| | | private final static String DOWNLOAD = "download"; |
| | | |
| | | private final static String COUNT = "count"; |
| | | |
| | | private final static String SPLIT = "\\\\"; |
| | | |
| | | private static final Log log = LogFactory.getLog(LogAspect.class); |
| | | |
| | |
| | | // 设置模块 |
| | | Api api = clazz.getAnnotation(Api.class); |
| | | if (api != null) { |
| | | String[] strs = api.tags()[0].split(SPLIT); |
| | | String[] strs = api.tags()[0].split(StaticData.BACKSLASH); |
| | | oe.setModular1(strs[0]); |
| | | oe.setModular2(strs[1]); |
| | | } |
| | |
| | | oe.setUserid(ue.getId()); |
| | | } |
| | | |
| | | operateService.insertOperate(oe); |
| | | // operateService.insertOperate(oe) |
| | | AsyncHelper helper = new AsyncHelper(); |
| | | helper.execute(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | operateService.insertOperate(oe); |
| | | } |
| | | }); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |