WAF策略:可以修改分组代号/导入时可以根据名称合并

This commit is contained in:
刘祥超
2021-12-12 20:24:41 +08:00
parent b333a90532
commit abd5c6dbb1
5 changed files with 122 additions and 90 deletions

View File

@@ -54,6 +54,16 @@ func (this *HTTPFirewallPolicy) FindRuleGroupWithCode(code string) *HTTPFirewall
return nil
}
// FindRuleGroupWithName 根据名称查找分组
func (this *HTTPFirewallPolicy) FindRuleGroupWithName(name string) *HTTPFirewallRuleGroup {
for _, g := range this.AllRuleGroups() {
if g.Name == name {
return g
}
}
return nil
}
// FindRuleGroup 根据ID查找分组
func (this *HTTPFirewallPolicy) FindRuleGroup(groupId int64) *HTTPFirewallRuleGroup {
for _, g := range this.AllRuleGroups() {