Spring boot 自定义注解

Spring boot 自定义注解如下:

三个很重要的注解:

@Target({ElementType.PARAMETER,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented

 

代码如下:

import java.lang.annotation.*;

/**
* 测试用例级别描述
*/
@Target({ElementType.PARAMETER,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MethodAnnotation {
/**
* 接口描述
* @return
*/
public String description() default "";

/**
* 创建时间
* @return
*/
public String createTime() default "0000-00-00";

/**
* 更新时间
* @return
*/
public String updateTime() default "0000-00-00";

/**
* 作者
* @return
*/
public String author() default "";

}
posted @ 2019-09-23 11:04  测试一枚  阅读(338)  评论(0编辑  收藏  举报