31 lines
666 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.designhub.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 角色验证注解
* 用于Controller方法上,标记需要的角色
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RequireRole {
/**
* 角色代码
*/
String[] value() default {};
/**
* 角色匹配模式:AND-需要所有角色,OR-需要任一角色
*/
LogicalMode mode() default LogicalMode.OR;
enum LogicalMode {
AND, OR
}
}