diff --git a/services/passport/client.go b/services/passport/client.go index 646a770..8444125 100644 --- a/services/passport/client.go +++ b/services/passport/client.go @@ -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 +} diff --git a/services/passport/userinfo.go b/services/passport/userinfo.go index 88a6650..fb45a89 100644 --- a/services/passport/userinfo.go +++ b/services/passport/userinfo.go @@ -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 +}