🎨客户端链接信息

This commit is contained in:
coward
2024-08-09 11:06:58 +08:00
parent 8f28f790e0
commit 864cf2f3f8
4 changed files with 75 additions and 2 deletions

View File

@@ -169,3 +169,14 @@ func (s client) GetByID(id string) (data *model.Client, err error) {
err = s.Model(&model.Client{}).Where("id = ?", id).Take(&data).Error
return
}
// GetByPublicKey
// @description: 通过公钥匹配客户端信息
// @receiver s
// @param pk
// @return data
// @return err
func (s client) GetByPublicKey(pk string) (data *model.Client, err error) {
err = s.Model(&model.Client{}).Where(fmt.Sprintf("json_extract(keys, '$.publicKey') = '%s'", pk)).First(&data).Error
return
}