Skip to content

Commit

Permalink
🐛 Fixed annotation handler missing
Browse files Browse the repository at this point in the history
  • Loading branch information
MisakaTAT committed Jun 14, 2024
1 parent 4fb60fb commit e649909
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 72 deletions.
69 changes: 0 additions & 69 deletions src/main/java/com/mikuac/shiro/common/utils/AopTargetUtils.java

This file was deleted.

7 changes: 4 additions & 3 deletions src/main/java/com/mikuac/shiro/core/BotFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.mikuac.shiro.model.HandlerMethod;
import com.mikuac.shiro.properties.ShiroProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -65,11 +66,11 @@ private MultiValueMap<Class<? extends Annotation>, HandlerMethod> getAnnotationH
// 获取 Spring 容器中所有指定类型的对象
Map<String, Object> beans = new HashMap<>(applicationContext.getBeansWithAnnotation(Shiro.class));
beans.values().forEach(obj -> {
Class<?> clazz = obj.getClass();
Arrays.stream(clazz.getMethods()).forEach(method -> {
Class<?> targetClass = AopProxyUtils.ultimateTargetClass(obj);
Arrays.stream(targetClass.getMethods()).forEach(method -> {
HandlerMethod handlerMethod = new HandlerMethod();
handlerMethod.setMethod(method);
handlerMethod.setType(clazz);
handlerMethod.setType(targetClass);
handlerMethod.setObject(obj);
Arrays.stream(method.getDeclaredAnnotations()).forEach(annotation -> {
Set<Class<?>> as = getAnnotations();
Expand Down

0 comments on commit e649909

Please sign in to comment.