增加修改服务所在分组API

This commit is contained in:
刘祥超
2022-06-25 19:21:46 +08:00
parent 56c09f5be7
commit 6002cc96d9
4 changed files with 86 additions and 5 deletions

View File

@@ -410,6 +410,17 @@ func (this *ServerGroupDAO) CheckUserGroup(tx *dbs.Tx, userId int64, groupId int
return nil
}
// ExistsGroup 检查分组ID是否存在
func (this *ServerGroupDAO) ExistsGroup(tx *dbs.Tx, groupId int64) (bool, error) {
if groupId <= 0 {
return false, nil
}
return this.Query(tx).
Pk(groupId).
State(ServerGroupStateEnabled).
Exist()
}
// NotifyUpdate 通知更新
func (this *ServerGroupDAO) NotifyUpdate(tx *dbs.Tx, groupId int64) error {
serverIds, err := SharedServerDAO.FindAllEnabledServerIdsWithGroupId(tx, groupId)