Skip to content

Commit

Permalink
chore:Add an IsDefaultRuleTemplate field to distinguish whether a rul…
Browse files Browse the repository at this point in the history
…e template is a default rule template.
  • Loading branch information
taolx0 committed Nov 15, 2024
1 parent 048a67c commit 29acc13
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sqle/api/controller/v1/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,12 @@ func getRuleTemplateTips(c echo.Context, projectId string, filterDBType string)

ruleTemplateTipsRes := make([]RuleTemplateTipResV1, 0, len(ruleTemplates))
for _, roleTemplate := range ruleTemplates {
isDefaultRuleTemplate := roleTemplate.Name == fmt.Sprintf("default_%s", roleTemplate.DBType)
ruleTemplateTipRes := RuleTemplateTipResV1{
ID: roleTemplate.GetIDStr(),
Name: roleTemplate.Name,
DBType: roleTemplate.DBType,
ID: roleTemplate.GetIDStr(),
Name: roleTemplate.Name,
DBType: roleTemplate.DBType,
IsDefaultRuleTemplate: isDefaultRuleTemplate,
}
ruleTemplateTipsRes = append(ruleTemplateTipsRes, ruleTemplateTipRes)
}
Expand Down

0 comments on commit 29acc13

Please sign in to comment.