diff --git a/IgnoreAuth.java b/IgnoreAuth.java new file mode 100644 index 0000000..7b47152 --- /dev/null +++ b/IgnoreAuth.java @@ -0,0 +1,18 @@ +// 定义该文件所在的包路径 +package com.annotation; + +// 导入注解相关的包 +import java.lang.annotation.*; + +// 忽略Token验证的注解 +// 被此注解标记的方法将跳过Token验证检查 +@Target(ElementType.METHOD) +// 指定该注解只能用于方法上 +@Retention(RetentionPolicy.RUNTIME) +// 指定该注解在运行时保留,可以通过反射读取 +@Documented +// 表示该注解应该被包含在JavaDoc中 +public @interface IgnoreAuth { + // 这是一个标记注解,不包含任何属性 + // 仅用于标识需要跳过Token验证的方法 +} \ No newline at end of file