首页 > 代码库 > 注解 给接口监控方法加上自定义拦截记录

注解 给接口监控方法加上自定义拦截记录

 

/**
* 自定义注解 拦截器
* @author 
* 给需要监控的方法加上改注解,就可以实现该方法的日志记录
*/
@Target({ ElementType.PARAMETER, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface WbmsService{
//描述
String description() default "";
//操作类型 同步:sync 异步 async
String oprateType() default "";
//客户名称
String clientName() default "";
}

使用方法 在被调用的方法实现类上添加该注解

@WbmsService(description = "客户欠款查询", oprateType = "sync", clientName = "")

注解 给接口监控方法加上自定义拦截记录