增加示例值解析 + 优化schema属性配置

This commit is contained in:
2025-02-20 16:22:23 +08:00
parent bd7f6d2cfd
commit d7cbf81799
4 changed files with 65 additions and 59 deletions

View File

@ -178,3 +178,19 @@ func (psf parseStructFieldTag) EnumDescription(structField reflect.StructField)
}
return res
}
// GetExampleValue 示例值
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 14:42 2025/2/20
func (psf parseStructFieldTag) GetExampleValue(structField reflect.StructField) string {
descTagList := []string{define.TagEg, define.TagExample}
for _, tag := range descTagList {
tagVal := structField.Tag.Get(tag)
if tagVal != "" {
return strings.ReplaceAll(tagVal, "###", "`")
}
}
return ""
}