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

perf: 脚本列表,脚本语言的排序需要按照语言名称的字典顺序 #1317 #1348

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

wangyu096
Copy link
Collaborator

No description provided.

@wangyu096 wangyu096 requested a review from jsonwan September 22, 2022 02:55
// ScriptTypeEnum
if (baseSearchCondition.getOrder() == Order.ASCENDING.getOrder()) {
// 按照脚本语言名称字典顺序排序.Bat(2)->Perl(3)->Powershell(5)->Python(4)->Shell(1)->SQL(6)
orderFields.add(DSL.field("field({0},2,3,5,4,1,6)", TB_SCRIPT.TYPE).asc());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特殊顺序的逻辑是否可以内聚到枚举类型中去,将来增加/修改枚举值时能够及时发现一并修改,放在这里是弱关联

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已优化

} else {
orderFields.add(TB_SCRIPT.TYPE.desc());
orderFields.add(DSL.field("field({0},2,3,5,4,1,6)", TB_SCRIPT.TYPE).desc());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已优化

Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2处问题需要看下

@jsonwan jsonwan merged commit 66586a5 into TencentBlueKing:3.5.x Sep 22, 2022
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

Successfully merging this pull request may close these issues.

2 participants