mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-05 14:40:33 +08:00
actually get the annotation metadata from classes
This commit is contained in:
parent
7b490320fa
commit
b50f3e7b8e
@ -1,5 +1,6 @@
|
||||
package io.papermc.hangar.security;
|
||||
|
||||
import io.papermc.hangar.controller.internal.ReviewController;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.core.GenericTypeResolver;
|
||||
import org.springframework.core.annotation.MergedAnnotations;
|
||||
@ -16,6 +17,7 @@ import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@ -40,7 +42,17 @@ public class HangarMetadataSources extends AbstractFallbackMethodSecurityMetadat
|
||||
|
||||
@Override
|
||||
protected Collection<ConfigAttribute> findAttributes(Method method, Class<?> targetClass) {
|
||||
return annotationExtractors.entrySet().stream().map(entry -> processAnnotation(method, entry)).flatMap(Collection::stream).collect(Collectors.toList());
|
||||
if (targetClass.equals(ReviewController.class)) {
|
||||
System.out.println(targetClass);
|
||||
}
|
||||
return Stream.concat(
|
||||
annotationExtractors.entrySet().stream()
|
||||
.map(entry -> processAnnotation(method, entry))
|
||||
.flatMap(Collection::stream),
|
||||
annotationExtractors.entrySet().stream()
|
||||
.map(entry -> processAnnotation(targetClass, entry))
|
||||
.flatMap(Collection::stream)
|
||||
).collect(Collectors.toUnmodifiableSet());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user