ExceptionService.java 777 B

123456789101112131415161718192021222324252627
  1. package com.uas.saas.admin.service;
  2. import com.uas.account.sso.integration.entity.UserAccount;
  3. import com.uas.saas.admin.entity.ExceptionLog;
  4. import com.uas.saas.admin.repository.ExceptionRepository;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.scheduling.annotation.Async;
  7. import org.springframework.stereotype.Service;
  8. import javax.servlet.http.HttpServletRequest;
  9. /**
  10. * @author yingp
  11. * @date 2018/4/19
  12. */
  13. @Service
  14. public class ExceptionService {
  15. @Autowired
  16. private ExceptionRepository exceptionRepository;
  17. @Async
  18. public void saveLog(HttpServletRequest req, Exception e, UserAccount account) {
  19. ExceptionLog log = new ExceptionLog(req, e, account);
  20. exceptionRepository.saveLog(log);
  21. }
  22. }