| | |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.moral.api.entity.UserLog; |
| | | import com.moral.api.service.UserLogService; |
| | |
| | | @Component |
| | | public class OperationLogUtils { |
| | | |
| | | private static UserLogService userLogService; |
| | | |
| | | @Autowired |
| | | public void setUserLogService(UserLogService userLogService) { |
| | | this.userLogService = userLogService; |
| | | } |
| | | private UserLogService userLogService; |
| | | |
| | | public static void insertLog(HttpServletRequest request, String content, String type) { |
| | | @Transactional |
| | | public void insertLog(HttpServletRequest request, String content, String type) { |
| | | String token = request.getHeader("token"); |
| | | Map<String, Object> currentUserInfo = (Map<String, Object>) TokenUtils.getUserInfoByToken(token); |
| | | UserLog userLog = new UserLog(); |