修改用户所属集群的时候同时修改其下的所有服务所属集群

This commit is contained in:
刘祥超
2020-12-23 19:44:50 +08:00
parent df6e0a59e4
commit 803d0c6344
5 changed files with 58 additions and 7 deletions

View File

@@ -1055,6 +1055,15 @@ func (this *ServerDAO) CheckUserServer(serverId int64, userId int64) error {
return nil
}
// 设置一个用户下的所有服务的所属集群
func (this *ServerDAO) UpdateUserServersClusterId(userId int64, clusterId int64) error {
_, err := this.Query().
Attr("userId", userId).
Set("clusterId", clusterId).
Update()
return err
}
// 生成DNS Name
func (this *ServerDAO) genDNSName() (string, error) {
for {