[用户平台][缓存]实现刷新和预热

This commit is contained in:
刘祥超
2020-12-23 21:24:48 +08:00
parent 803d0c6344
commit ed34a387c7
7 changed files with 56 additions and 5 deletions

View File

@@ -1064,6 +1064,17 @@ func (this *ServerDAO) UpdateUserServersClusterId(userId int64, clusterId int64)
return err
}
// 查找用户的所有的服务
func (this *ServerDAO) FindAllEnabledServersWithUserId(userId int64) (result []*Server, err error) {
_, err = this.Query().
State(ServerStateEnabled).
Attr("userId", userId).
DescPk().
Slice(&result).
FindAll()
return
}
// 生成DNS Name
func (this *ServerDAO) genDNSName() (string, error) {
for {