提供修改网站名称的接口

This commit is contained in:
刘祥超
2023-03-31 15:30:22 +08:00
parent dbeabe4379
commit df775272be
2 changed files with 44 additions and 0 deletions

View File

@@ -32,6 +32,10 @@ const (
ServerStateDisabled = 0 // 已禁用
)
const (
ModelServerNameMaxLength = 60
)
type ServerDAO dbs.DAO
func NewServerDAO() *ServerDAO {
@@ -2784,6 +2788,14 @@ func (this *ServerDAO) UpdateServerUserId(tx *dbs.Tx, serverId int64, userId int
return this.NotifyUpdate(tx, serverId)
}
// UpdateServerName 修改服务名
func (this *ServerDAO) UpdateServerName(tx *dbs.Tx, serverId int64, name string) error {
return this.Query(tx).
Pk(serverId).
Set("name", name).
UpdateQuickly()
}
// NotifyUpdate 同步服务所在的集群
func (this *ServerDAO) NotifyUpdate(tx *dbs.Tx, serverId int64) error {
// 创建任务