优化代码

This commit is contained in:
刘祥超
2020-12-17 17:36:20 +08:00
parent 1766ed67fc
commit 1b6e2819e3
9 changed files with 114 additions and 71 deletions

View File

@@ -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().