SpringDemo/src/main/java/com/example/springdemo/utils/RoleVerificationAnnotation.java
2023-11-06 18:40:32 +08:00

16 lines
481 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.example.springdemo.utils;
// 在Controller中使用该注解可以实现权限验证
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
@Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE})
@Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
public @interface RoleVerificationAnnotation {
//有权限访问的角色ID
long[] RoleIDList() default {1};
long[] UserIDList() default {};
}