基于Springboot实现自定义注解用于统计函数耗时分析
发布时间
阅读量:
阅读量
使用Springboot 自定义注解完成 统计函数耗时功能
Maven依赖配置
创建Spring Boot工程,并在对应的pom文件中引入所需依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
自定义注解costTime设计与实现
package com.costtime.annotation.entity;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface CostTime {
}
其中
元注解:用于对其他注解进行标注
@Target,@Retention,@Docume
全部评论 (0)
还没有任何评论哟~
