From 2d6c82e24906e18ec8b42c98661ce2e629b72350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B6=E8=8C=82=E6=96=B0?= Date: Fri, 12 Dec 2025 12:11:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(passport):=20=E6=96=B0=E5=A2=9E=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E7=94=A8=E6=88=B7=E6=A0=87=E7=AD=BE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/passport/client.go | 8 +++++++ services/passport/userinfo.go | 44 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) 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 +}