mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-14 14:50:24 +08:00
增加DNS域名管理
This commit is contained in:
@@ -272,7 +272,8 @@ func (this *NodeClusterDAO) FindAllEnabledClustersWithGrantId(grantId int64) (re
|
||||
func (this *NodeClusterDAO) CountAllEnabledClustersWithDNSProviderId(dnsProviderId int64) (int64, error) {
|
||||
return this.Query().
|
||||
State(NodeClusterStateEnabled).
|
||||
Attr("dnsProviderId", dnsProviderId).
|
||||
Where("dnsDomainId IN (SELECT id FROM "+SharedDNSDomainDAO.Table+" WHERE state=1 AND providerId=:providerId)").
|
||||
Param("providerId", dnsProviderId).
|
||||
Count()
|
||||
}
|
||||
|
||||
@@ -280,13 +281,22 @@ func (this *NodeClusterDAO) CountAllEnabledClustersWithDNSProviderId(dnsProvider
|
||||
func (this *NodeClusterDAO) FindAllEnabledClustersWithDNSProviderId(dnsProviderId int64) (result []*NodeCluster, err error) {
|
||||
_, err = this.Query().
|
||||
State(NodeClusterStateEnabled).
|
||||
Attr("dnsProviderId", dnsProviderId).
|
||||
Where("dnsDomainId IN (SELECT id FROM "+SharedDNSDomainDAO.Table+" WHERE state=1 AND providerId=:providerId)").
|
||||
Param("providerId", dnsProviderId).
|
||||
Slice(&result).
|
||||
DescPk().
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
// 计算使用某个DNS域名的集群数量
|
||||
func (this *NodeClusterDAO) CountAllEnabledClustersWithDNSDomainId(dnsDomainId int64) (int64, error) {
|
||||
return this.Query().
|
||||
State(NodeClusterStateEnabled).
|
||||
Attr("dnsDomainId", dnsDomainId).
|
||||
Count()
|
||||
}
|
||||
|
||||
// 查找集群的认证ID
|
||||
func (this *NodeClusterDAO) FindClusterGrantId(clusterId int64) (int64, error) {
|
||||
return this.Query().
|
||||
|
||||
Reference in New Issue
Block a user