Commit c5077443 authored by qiuqunfeng's avatar qiuqunfeng
Browse files

Add support for multilingual rule categories in ListRules method

- Extend ListRules method to handle English and Chinese categories
- Append appropriate category names and descriptions based on selected language
- Ensure consistent response structure for rule group responses
parent 84abaec3
...@@ -900,6 +900,24 @@ func (s *wafService) ListRules(ctx context.Context, regionCode, namespace, gatew ...@@ -900,6 +900,24 @@ func (s *wafService) ListRules(ctx context.Context, regionCode, namespace, gatew
}) })
} }
} }
} else {
for _, category := range ruleCategories {
if language == "en" {
ruleGroupResp = append(ruleGroupResp, RuleGroupResp{
CategoryID: category.CategoryID,
Status: category.Status,
Category: category.CategoryEN,
Description: category.DescriptionEN,
})
} else {
ruleGroupResp = append(ruleGroupResp, RuleGroupResp{
CategoryID: category.CategoryID,
Status: category.Status,
Category: category.CategoryZH,
Description: category.DescriptionZH,
})
}
}
} }
return ruleGroupResp, nil return ruleGroupResp, nil
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment