mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-03 22:06:36 +08:00
网站服务变更也能自动同步DNS
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/iwind/TeaGo/Tea"
|
||||
"github.com/iwind/TeaGo/dbs"
|
||||
"github.com/iwind/TeaGo/types"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -131,3 +132,12 @@ func (this *DNSProviderDAO) FindAllEnabledDNSProvidersWithType(providerType stri
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
// 更新数据更新时间
|
||||
func (this *DNSProviderDAO) UpdateProviderDataUpdatedTime(providerId int64) error {
|
||||
_, err := this.Query().
|
||||
Pk(providerId).
|
||||
Set("dataUpdatedAt", time.Now().Unix()).
|
||||
Update()
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -862,6 +862,14 @@ func (this *ServerDAO) createEvent() error {
|
||||
return SharedSysEventDAO.CreateEvent(NewServerChangeEvent())
|
||||
}
|
||||
|
||||
// 查询当前服务的ClusterId
|
||||
func (this *ServerDAO) FindServerClusterId(serverId int64) (int64, error) {
|
||||
return this.Query().
|
||||
Pk(serverId).
|
||||
Result("clusterId").
|
||||
FindInt64Col(0)
|
||||
}
|
||||
|
||||
// 生成DNS Name
|
||||
func (this *ServerDAO) genDNSName() (string, error) {
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user