You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
638 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.annotation;
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 {
}