-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/goai: When generating enums documents and validating enums, is it possible to support customizing the actual interactive enumeration values? ? #4082
Comments
@shuqingzai 你可以把 |
@shuqingzai You can define the enumeration type and enumeration value of |
@gqcn 谢谢你的回复,但是我不太明白你所说的内部自行转换?可以说清楚点吗? 我希望可以在文档和 根据你说的,我的理解是你让我定义字符串 enums ,但是存入库时, SQL 的 Scan 和 Value 读取和返回数字,我不知道是否有理解错? |
@gqcn Thank you for your reply, but I don’t quite understand what you mean by internal self-conversion? Can you make it clearer? I hope this is reflected in the documentation and
According to what you said, my understanding is that you asked me to define string enums, but when storing it in the database, SQL's Scan and Value read and return numbers. I don't know if I understand it wrong? |
@shuqingzai 我的思路如下,你看看有没什么问题或者建议:
|
@shuqingzai My idea is as follows, please see if you have any questions or suggestions:
|
@gqcn 按你说的,我理解应该没错,但是这改变了初衷,直接移除了 int 转向 string
|
Is your feature request related to a problem?
Option Yes
Describe the solution you'd like
目前使用
make enums
生成 enums 注入程序时,只会直接获取实际枚举值作为注入内容,是否有策略可以自定义写入内容,类似 Java 或 C# 的枚举类,自定义映射值参考下面的文件,希望对外显示的是
string
而不是int
( OpenAPI文档与验证enums
)Describe alternatives you've considered
可以支持自定义接口实现返回枚举值的真实值列表??
Additional
No response
The text was updated successfully, but these errors were encountered: