feat(passport): 新增获取用户标签接口
This commit is contained in:
parent
93d9f0bc2e
commit
2d6c82e249
@ -79,3 +79,11 @@ func (c *Client) UpdateUserState(req *UpdateUserStateRequest) (response *UpdateU
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
||||
// GetUserLabels
|
||||
// 获取用户标签
|
||||
func (c *Client) GetUserLabels(req *GetUserLabelsRequest) (response *GetUserLabelsResponse, err error) {
|
||||
response = CreateGetUserLabelsResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
||||
@ -200,3 +200,47 @@ func CreateGetUserGameSignResponse() (response *GetUserGameSignResponse) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type GetUserLabelsRequest struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type GetUserLabelsResponse struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data []UserLabel `json:"data"`
|
||||
}
|
||||
|
||||
type UserLabel struct {
|
||||
LabelId int64 `json:"label_id"`
|
||||
UserName string `json:"user_name"`
|
||||
}
|
||||
|
||||
// CreateGetUserLabelsRequest 获取用户标签
|
||||
func CreateGetUserLabelsRequest(userNames, labelIds string) (req *GetUserLabelsRequest) {
|
||||
ts, sign := GetSign()
|
||||
|
||||
req = &GetUserLabelsRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
|
||||
req.FormParams = map[string]string{
|
||||
"act": "info",
|
||||
"do": "get_user_labels",
|
||||
"user_names": userNames,
|
||||
"label_ids": labelIds,
|
||||
"time": fmt.Sprintf("%v", ts),
|
||||
"sign": sign,
|
||||
}
|
||||
|
||||
req.Method = requests.POST
|
||||
return
|
||||
}
|
||||
|
||||
func CreateGetUserLabelsResponse() (response *GetUserLabelsResponse) {
|
||||
response = &GetUserLabelsResponse{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user