Skip to content
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

Request parameter enumeration class display optimization suggestions #960

Open
3 tasks done
tonghejiao opened this issue Nov 24, 2024 · 4 comments
Open
3 tasks done

Comments

@tonghejiao
Copy link

tonghejiao commented Nov 24, 2024

Is your feature request related to a problem? Please describe.(关于这个PR的描述,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

chinese: 使用smartdoc常常遇到一个问题,就是请求参数的枚举类的展示不太符合我们的需求,如下图。我们往往需要将枚举类的第一个参数作为下图表格的“值”,第一个参数的类型作为下图 表格的“类型”,第二个参数作为下图的描述。
english: A common problem with smartdoc is that the presentation of the enumeration class of request parameters does not quite meet our requirements, as shown in the following figure. We often need to use the first parameter of the enumeration class as the "value" of the following table, the type of the first parameter as the "type" of the following table, and the second parameter as the description of the following table.
image

Basic example (PR的用例,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

nothing

Describe the solution you'd like (描述您想要的解决方案,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

nothing

Describe alternatives you've considered (描述你考虑过的替代方案,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

chinese: 源码修改建议:修改下图代码即可。下图圈出来的部分是为了读取枚举类的“值”、“类型”、“描述”
english: Source code modification suggestion: Modify the following code can be. The sections circled below are for reading the "value", "type", "description" of the enumerated class.
image

Additional context (其他背景信息,社区已开启国际化推广,请文心一言、讯飞星火等辅助翻译成英文,减少社区开发者的工作)

chinese: 可以提供两种枚举展示的模式,默认是现在这种,还有就是我这种。在配置文件里可以选择其中一种模式
english: You can provide two modes of enumeration display, the default is the present one, and the default is mine. You can select one of these modes in the configuration file.

Validations

  • Read the docs. (请先阅读官方文档)
  • Read the Contributing Guidelines. (请先阅读官方文档·贡献指南)
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. (检查是否存在报告相同错误的问题,以避免产生重复)
@shalousun
Copy link
Collaborator

@tonghejiao please translate it into english

@tonghejiao
Copy link
Author

tonghejiao commented Nov 24, 2024

@tonghejiao please translate it into english
done. and can I participate in writing this code?

@tonghejiao tonghejiao changed the title 请求参数里枚举类展示的优化建议 Request parameter enumeration class display optimization suggestions Nov 24, 2024
@shalousun
Copy link
Collaborator

shalousun commented Nov 24, 2024

@tonghejiao please translate it into english
done. and can I participate in writing this code?

We welcome contributions to the community. You can supplement your enum definition and the code used for input parameters. If the enum uses the JsonValue annotation, please indicate that as well. Since Smart-Doc highly advocates for industry best practices, the community needs to analyze your use case to determine whether implementation is necessary.

@jasonkung22
Copy link
Contributor

jasonkung22 commented Dec 5, 2024

#977 A lot of changes have been made to the enumeration, If the enumeration is not configured with a data dictionary, the first parameter of the enumeration is used as enumValue by default, and the comment of the enumeration is used as the enumDesc,and you can see if it meets your needs. @tonghejiao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants