增加计算WAF动作数量API

This commit is contained in:
GoEdgeLab
2021-02-24 15:02:49 +08:00
parent 40509045b0
commit 3b71e62a3d
2 changed files with 23 additions and 0 deletions

View File

@@ -153,6 +153,14 @@ func (this *NodeClusterFirewallActionDAO) ComposeFirewallActionConfig(tx *dbs.Tx
return config, nil
}
// 计算动作数量
func (this *NodeClusterFirewallActionDAO) CountAllEnabledFirewallActions(tx *dbs.Tx, clusterId int64) (int64, error) {
return this.Query(tx).
State(NodeClusterFirewallActionStateEnabled).
Attr("clusterId", clusterId).
Count()
}
// 通知更新
func (this *NodeClusterFirewallActionDAO) NotifyUpdate(tx *dbs.Tx, actionId int64) error {
clusterId, err := this.Query(tx).