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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.swagger.v3.oas.models.media.Schema<?>customize(io.swagger.v3.oas.models.media.Schema property, io.swagger.v3.core.converter.AnnotatedType type) private Stringdict 键对值private StringenumInfo(cn.sinozg.applet.common.annotation.EnumField ef) 获取枚举值的键值对private StringwrapUp(StringBuilder info, boolean error, boolean isDict, String dictName) 转html 语言
-
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:
customizein interfaceorg.springdoc.core.customizers.PropertyCustomizer
-
enumInfo
获取枚举值的键值对- Parameters:
ef- 枚举值- Returns:
- 信息
- Throws:
Exception- 异常
-
dictPair
dict 键对值- Parameters:
dict- dict- Returns:
- 数据
-
wrapUp
转html 语言- Parameters:
info- 键对值信息error- 是否错误dictName- 名称- Returns:
- 文本
-