mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-02 12:06:34 +08:00
实现基本的集群DNS列表、设置、简单数据同步
This commit is contained in:
@@ -125,7 +125,7 @@ func (this *NodeIPAddressDAO) UpdateAddressNodeId(addressId int64, nodeId int64)
|
||||
return err
|
||||
}
|
||||
|
||||
// 查找某个节点所有的IP地址
|
||||
// 查找节点的所有的IP地址
|
||||
func (this *NodeIPAddressDAO) FindAllEnabledAddressesWithNode(nodeId int64) (result []*NodeIPAddress, err error) {
|
||||
_, err = this.Query().
|
||||
Attr("nodeId", nodeId).
|
||||
@@ -136,3 +136,15 @@ func (this *NodeIPAddressDAO) FindAllEnabledAddressesWithNode(nodeId int64) (res
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
// 查找节点的第一个可访问的IP地址
|
||||
func (this *NodeIPAddressDAO) FindFirstNodeIPAddress(nodeId int64) (string, error) {
|
||||
return this.Query().
|
||||
Attr("nodeId", nodeId).
|
||||
State(NodeIPAddressStateEnabled).
|
||||
Attr("canAccess", true).
|
||||
Desc("order").
|
||||
AscPk().
|
||||
Result("ip").
|
||||
FindStringCol("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user