Log.java 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package com.doc.common.annotation;
  2. import com.doc.common.enums.BusinessType;
  3. import com.doc.common.enums.EventLevel;
  4. import com.doc.common.enums.EventType;
  5. import com.doc.common.enums.OperatorType;
  6. import java.lang.annotation.*;
  7. /**
  8. * 自定义操作日志记录注解
  9. * 使用说明
  10. *
  11. * @author ruoyi
  12. * *** @Log(title = "用户管理", businessType = BusinessType.DELETE, eventLevel = EventLevel.HIGH)
  13. * eventLevel 默认为LOW ,eventType默认为BUSINESS ,
  14. * 当level和type为默认值的时候,可以不写
  15. */
  16. @Target({ElementType.PARAMETER, ElementType.METHOD})
  17. @Retention(RetentionPolicy.RUNTIME)
  18. @Documented
  19. public @interface Log {
  20. /**
  21. * 模块
  22. */
  23. public String title() default "";
  24. /**
  25. * 功能
  26. */
  27. public BusinessType businessType() default BusinessType.OTHER;
  28. /**
  29. * 操作人类别
  30. */
  31. public OperatorType operatorType() default OperatorType.MANAGE;
  32. /**
  33. * 事件类型
  34. */
  35. public EventType eventType() default EventType.BUSINESS;
  36. /**
  37. * 事件类型
  38. */
  39. public EventLevel eventLevel() default EventLevel.LOW;
  40. /**
  41. * 是否保存请求的参数
  42. */
  43. public boolean isSaveRequestData() default true;
  44. /**
  45. * 是否保存响应的参数
  46. */
  47. public boolean isSaveResponseData() default true;
  48. /**
  49. * 排除指定的请求参数
  50. */
  51. public String[] excludeParamNames() default {};
  52. }