Class EnumFieldCustomizer

java.lang.Object
cn.sinozg.applet.common.customizer.EnumFieldCustomizer
All Implemented Interfaces:
org.springdoc.core.customizers.PropertyCustomizer

@Component public class EnumFieldCustomizer extends Object implements org.springdoc.core.customizers.PropertyCustomizer
将字段的枚举值写入到 swagger
Since:
2023-12-10 12:04
Author:
xieyubin
  • Field Details

    • log

      public static final org.slf4j.Logger log
  • Constructor Details

    • EnumFieldCustomizer

      public EnumFieldCustomizer()
  • Method Details

    • customize

      public io.swagger.v3.oas.models.media.Schema<?> customize(io.swagger.v3.oas.models.media.Schema property, io.swagger.v3.core.converter.AnnotatedType type)
      Specified by:
      customize in interface org.springdoc.core.customizers.PropertyCustomizer
    • enumInfo

      private String enumInfo(cn.sinozg.applet.common.annotation.EnumField ef) throws Exception
      获取枚举值的键值对
      Parameters:
      ef - 枚举值
      Returns:
      信息
      Throws:
      Exception - 异常
    • dictPair

      private String dictPair(DictTrans dict)
      dict 键对值
      Parameters:
      dict - dict
      Returns:
      数据
    • wrapUp

      private String wrapUp(StringBuilder info, boolean error, boolean isDict, String dictName)
      转html 语言
      Parameters:
      info - 键对值信息
      error - 是否错误
      dictName - 名称
      Returns:
      文本