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 12, 2024
1 parent 78b53e0 commit 7c29154
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 @@ -448,10 +448,12 @@ func convertDefaultRuleTemplatesToRes(ctx context.Context, ruleTemplates []*mode

ruleTemplatesReq := make([]RuleTemplateResV1, 0, len(ruleTemplates))
for _, ruleTemplate := range ruleTemplates {
isDefaultRuleTemplate := ruleTemplate.Name == fmt.Sprintf("default_%s", ruleTemplate.DBType)
ruleTemplateReq := RuleTemplateResV1{
Name: ruleTemplate.Name,
Desc: locale.Bundle.LocalizeMsgByCtx(ctx, locale.DefaultRuleTemplatesDesc),
DBType: ruleTemplate.DBType,
Name: ruleTemplate.Name,
Desc: locale.Bundle.LocalizeMsgByCtx(ctx, locale.DefaultRuleTemplatesDesc),
DBType: ruleTemplate.DBType,

Check failure on line 455 in sqle/api/controller/v1/rule.go

View workflow job for this annotation

GitHub Actions / lint

unknown field `IsDefaultRuleTemplate` in struct literal (typecheck)
IsDefaultRuleTemplate: isDefaultRuleTemplate,
}
ruleTemplatesReq = append(ruleTemplatesReq, ruleTemplateReq)
}
Expand Down

0 comments on commit 7c29154

Please sign in to comment.