branch1
18655803770 4 months ago
parent e51345e706
commit 3c19495e91

@ -4,9 +4,12 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
//11111
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface APPLoginUser {
/**
* APPLoginUser
*
*/
@Target(ElementType.PARAMETER) // 表明该注解只能用于方法参数上
@Retention(RetentionPolicy.RUNTIME) // 注解在运行时可用,可以通过反射获取
public @interface APPLoginUser {
}

@ -2,9 +2,19 @@ package com.annotation;
import java.lang.annotation.*;
// 定义一个自定义注解名为 IgnoreAuth
// 使用 @Target 注解指定该注解可以应用的目标元素类型为方法ElementType.METHOD
@Target(ElementType.METHOD)
// 使用 @Retention 注解指定该注解在运行时是否可用
// RetentionPolicy.RUNTIME 表示该注解在运行时可以通过反射获取
@Retention(RetentionPolicy.RUNTIME)
// 使用 @Documented 注解表示该注解会被包含在 JavaDoc 文档中
@Documented
// 定义一个空的自定义注解 IgnoreAuth
public @interface IgnoreAuth {
}

@ -4,8 +4,16 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
// 定义一个自定义注解名为 LoginUser
// 使用 @Target 注解指定该注解可以应用的目标元素类型为参数ElementType.PARAMETER
@Target(ElementType.PARAMETER)
// 使用 @Retention 注解指定该注解在运行时是否可用
// RetentionPolicy.RUNTIME 表示该注解在运行时可以通过反射获取
@Retention(RetentionPolicy.RUNTIME)
// 定义一个空的自定义注解 LoginUser
public @interface LoginUser {
}

Loading…
Cancel
Save