perf:key不用实现TsAuthorityHandler类

This commit is contained in:
曾文豪
2024-08-27 13:41:00 +08:00
parent 0310bd4a15
commit fd30c5cf36

View File

@@ -5,12 +5,12 @@ import cn.hutool.core.date.DateUtil;
import com.tiesheng.annotation.role.RoleAuthority;
import com.tiesheng.util.service.role.TsAuthorityHandler;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Date;
@@ -20,12 +20,17 @@ import java.util.Map;
@Service
public class RoleAuthorityCreator implements ApplicationListener<ContextRefreshedEvent> {
@Resource
@Autowired(required = false)
TsAuthorityHandler tsAuthorityHandler;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (tsAuthorityHandler == null) {
return;
}
ApplicationContext applicationContext = event.getApplicationContext();
Map<String, Object> beansOfType = applicationContext.getBeansWithAnnotation(RoleAuthority.class);