DictionaryAspect.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package com.lantone.security.aop;
  2. import com.lantone.security.component.MessageSender;
  3. import org.aspectj.lang.annotation.After;
  4. import org.aspectj.lang.annotation.Aspect;
  5. import org.aspectj.lang.annotation.Pointcut;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Component;
  8. /**
  9. * @Description: 系统字典信息变更统一处理切面
  10. * @author: rengb
  11. * @time: 2021/8/26 10:43
  12. */
  13. @Aspect
  14. @Component
  15. public class DictionaryAspect {
  16. @Autowired
  17. private MessageSender messageSender;
  18. @Pointcut("execution(public * com.lantone.security.web.UserManagementController.login(..))")
  19. private DictionaryInfoFacade dictionaryInfoFacade;
  20. @Pointcut("execution(public * com.lantone.security.web.DictionaryManagementController.addDictionary(..))" +
  21. "||execution(public * com.lantone.security.web.DictionaryManagementController.updateDictionary(..))" +
  22. "||execution(public * com.lantone.security.web.DictionaryManagementController.deleteDictionary(..))")
  23. public void basicInfoChange() {
  24. }
  25. @After("basicInfoChange()")
  26. public void aspectAfter() {
  27. messageSender.sendRedisCacheRefreshMessage(DictionaryAspect.class.getSimpleName());
  28. }
  29. }