| | |
| | | package com.whyc.util; |
| | | |
| | | import com.whyc.pojo.UserInf; |
| | | import com.whyc.service.UserLogService; |
| | | import com.whyc.service.DocLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.system.ApplicationHome; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Component |
| | | public class CommonUtil { |
| | | |
| | | private static UserLogService userLogService; |
| | | private static DocLogService docLogService; |
| | | |
| | | @Autowired |
| | | public void setUserLogService(UserLogService userLogService) { |
| | | CommonUtil.userLogService = userLogService; |
| | | public void setUserLogService(DocLogService docLogService) { |
| | | CommonUtil.docLogService = docLogService; |
| | | } |
| | | |
| | | /**获取当前Session中的属性user*/ |
| | |
| | | |
| | | /**手动记录特定日志*/ |
| | | public static void record(long uId, int operationType, String msg){ |
| | | userLogService.record(uId,operationType,msg); |
| | | docLogService.record(uId,operationType,msg); |
| | | } |
| | | |
| | | /**手动记录特定日志*/ |
| | | public static void record(long uId, int operationType, String msg,String msgDetail){ |
| | | userLogService.record(uId,operationType,msg,msgDetail); |
| | | docLogService.record(uId,operationType,msg,msgDetail); |
| | | } |
| | | /**手动记录特定日志*/ |
| | | public static void record2(HttpServletRequest request,long uId, int operationType, String msg,String msgDetail){ |
| | | userLogService.record2(request,uId,operationType,msg,msgDetail); |
| | | docLogService.record2(request,uId,operationType,msg,msgDetail); |
| | | } |
| | | } |