:new:完成客户端链接状态监控
This commit is contained in:
@@ -162,8 +162,16 @@ func (r clientRepo) Delete(id string) (err error) {
|
||||
// @return err
|
||||
func (r clientRepo) GetById(id string) (data entity.Client, err error) {
|
||||
err = r.Model(&entity.Client{}).Where("id = ?", id).Preload("Server").First(&data).Error
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetByPublicKey
|
||||
// @description: 根据公钥获取客户端信息
|
||||
// @receiver r
|
||||
// @param publicKey
|
||||
// @return data
|
||||
// @return err
|
||||
func (r clientRepo) GetByPublicKey(publicKey string) (data entity.Client, err error) {
|
||||
err = r.Model(&entity.Client{}).Where("keys->$.publicKey = ?", publicKey).Preload("Server").First(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user