使用Springboot 自定义注解完成 统计函数耗时功能
pom 导入依赖
建立springboot项目,在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 {