服务没有所属用户时,可以修改所属用户

This commit is contained in:
刘祥超
2022-12-21 17:07:02 +08:00
parent 13c78a5fec
commit 05d79ad606
6 changed files with 175 additions and 9 deletions

View File

@@ -306,6 +306,18 @@ func (this *SSLPolicyDAO) CheckUserPolicy(tx *dbs.Tx, userId int64, policyId int
return nil
}
// UpdatePolicyUser 修改策略所属用户
func (this *SSLPolicyDAO) UpdatePolicyUser(tx *dbs.Tx, policyId int64, userId int64) error {
if policyId <= 0 || userId <= 0 {
return nil
}
return this.Query(tx).
Pk(policyId).
Set("userId", userId).
UpdateQuickly()
}
// NotifyUpdate 通知更新
func (this *SSLPolicyDAO) NotifyUpdate(tx *dbs.Tx, policyId int64) error {
serverIds, err := SharedServerDAO.FindAllEnabledServerIdsWithSSLPolicyIds(tx, []int64{policyId})