🆕新增接口强制下线指定客户端
This commit is contained in:
@@ -175,3 +175,12 @@ func (r clientRepo) GetByPublicKey(publicKey string) (data entity.Client, err er
|
||||
err = r.Model(&entity.Client{}).Where("keys->$.publicKey = ?", publicKey).Preload("Server").First(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
// Disabled
|
||||
// @description: 禁用客户端
|
||||
// @receiver r
|
||||
// @param id
|
||||
// @return err
|
||||
func (r clientRepo) Disabled(id string) (err error) {
|
||||
return r.Model(&entity.Client{}).Where("id = ?", id).Update("status", 0).Error
|
||||
}
|
||||
|
Reference in New Issue
Block a user