liujie
2026-01-14 f976a39b294f8c7dd60bcd2c661983c0dcc97fc6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.estate.expert.common.log;
 
import java.lang.annotation.*;
 
/**
 * 忽略请求日志annotation.
 * 默认所有的请求都会被通过拦截器拦截并打印日志信息.如果是敏感接口,或者文件流而不需要打印日志
 * 可以通过这个annotation来指定接口不需要打印.
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface IgnoreRequestLog {
    IgnoreType[] types() default {IgnoreType.REQUEST, IgnoreType.RESPONSE};
 
    enum IgnoreType {
        /** 忽略请求日志 */
        REQUEST,
        /** 忽略响应日志 */
        RESPONSE,
        /** SILENT -> 整个接口请求,不输出日志 */
        SILENT,
    }
}