mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-18 20:00:25 +08:00
优化代码
This commit is contained in:
@@ -609,6 +609,14 @@ func (this *NodeClusterDAO) FindAllEnabledNodeClustersWithHTTPFirewallPolicyId(h
|
||||
return
|
||||
}
|
||||
|
||||
// 获取集群的WAF策略ID
|
||||
func (this *NodeClusterDAO) FindClusterHTTPFirewallPolicyId(clusterId int64) (int64, error) {
|
||||
return this.Query().
|
||||
Pk(clusterId).
|
||||
Result("httpFirewallPolicyId").
|
||||
FindInt64Col(0)
|
||||
}
|
||||
|
||||
// 设置集群的缓存策略
|
||||
func (this *NodeClusterDAO) UpdateNodeClusterHTTPCachePolicyId(clusterId int64, httpCachePolicyId int64) error {
|
||||
_, err := this.Query().
|
||||
@@ -618,6 +626,14 @@ func (this *NodeClusterDAO) UpdateNodeClusterHTTPCachePolicyId(clusterId int64,
|
||||
return err
|
||||
}
|
||||
|
||||
// 获取集群的缓存策略ID
|
||||
func (this *NodeClusterDAO) FindClusterHTTPCachePolicyId(clusterId int64) (int64, error) {
|
||||
return this.Query().
|
||||
Pk(clusterId).
|
||||
Result("cachePolicyId").
|
||||
FindInt64Col(0)
|
||||
}
|
||||
|
||||
// 设置集群的WAF策略
|
||||
func (this *NodeClusterDAO) UpdateNodeClusterHTTPFirewallPolicyId(clusterId int64, httpFirewallPolicyId int64) error {
|
||||
_, err := this.Query().
|
||||
|
||||
Reference in New Issue
Block a user