🆕新增接口强制下线指定客户端

This commit is contained in:
coward
2024-03-15 15:43:37 +08:00
parent 30cc35ae00
commit 259cd39902
5 changed files with 95 additions and 6 deletions

View File

@@ -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
}