Digital Office Automation System Backend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Translation.java 1004B

2 月之前
123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.ruoyi.common.annotation;
  2. import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
  3. import com.fasterxml.jackson.databind.annotation.JsonSerialize;
  4. import com.ruoyi.common.translation.handler.TranslationHandler;
  5. import java.lang.annotation.*;
  6. /**
  7. * 通用翻译注解
  8. *
  9. * @author Lion Li
  10. */
  11. @Inherited
  12. @Retention(RetentionPolicy.RUNTIME)
  13. @Target({ElementType.FIELD, ElementType.METHOD})
  14. @Documented
  15. @JacksonAnnotationsInside
  16. @JsonSerialize(using = TranslationHandler.class)
  17. public @interface Translation {
  18. /**
  19. * 类型 (需与实现类上的 {@link com.ruoyi.common.annotation.TranslationType} 注解type对应)
  20. * <p>
  21. * 默认取当前字段的值 如果设置了 @{@link Translation#mapper()} 则取映射字段的值
  22. */
  23. String type();
  24. /**
  25. * 映射字段 (如果不为空则取此字段的值)
  26. */
  27. String mapper() default "";
  28. /**
  29. * 其他条件 例如: 字典type(sys_user_sex)
  30. */
  31. String other() default "";
  32. }