封装passport获取用户登录过的游戏大类接口
This commit is contained in:
parent
7b904f4d5f
commit
c0b4a0d83c
@ -55,3 +55,11 @@ func (c *Client) EditCard(req EditCardRequestParam) (response string, err error)
|
||||
}
|
||||
return createEditCardResponse.GetHttpContentString(), nil
|
||||
}
|
||||
|
||||
// GetUserGameSign
|
||||
// 获取用户登录过的游戏大类
|
||||
func (c *Client) GetUserGameSign(req *GetUserGameSignRequest) (response *GetUserGameSignResponse, err error) {
|
||||
response = CreateGetUserGameSignResponse()
|
||||
err = c.DoAction(req, response)
|
||||
return
|
||||
}
|
||||
|
@ -63,3 +63,18 @@ func TestEditCard(t *testing.T) {
|
||||
t.Logf("%v", editCardResponse)
|
||||
|
||||
}
|
||||
|
||||
// 测试获取用户登录过的游戏大类
|
||||
func TestGetUserGameSign(t *testing.T) {
|
||||
client, err := NewClient()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
req := CreateGetUserGameSignRequest("oo70683572", "", "")
|
||||
resp, err := client.GetUserGameSign(req)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
t.Logf("resp code:%+v", resp.Code)
|
||||
t.Logf("resp data:%+v", resp.Data)
|
||||
}
|
||||
|
@ -114,3 +114,63 @@ func CreateGetUserRoleListResponse() (response *GetUserRoleListResponse) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type GetUserGameSignRequest struct {
|
||||
*requests.RpcRequest
|
||||
}
|
||||
|
||||
type GetUserGameSignResponse struct {
|
||||
*responses.BaseResponse
|
||||
Code int `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data struct {
|
||||
List []UserGameSign `json:"list"`
|
||||
} `json:"data"`
|
||||
}
|
||||
|
||||
type UserGameSign struct {
|
||||
Id string `json:"id"`
|
||||
AgentId string `json:"agent_id"`
|
||||
SiteId string `json:"site_id"`
|
||||
Uid string `json:"uid"`
|
||||
UserName string `json:"user_name"`
|
||||
GameId string `json:"game_id"`
|
||||
GameSign string `json:"game_sign"`
|
||||
Oaid string `json:"oaid"`
|
||||
Imei string `json:"imei"`
|
||||
Imei2 string `json:"imei2"`
|
||||
Ua string `json:"ua"`
|
||||
FirstLoginIp string `json:"first_login_ip"`
|
||||
FirstLoginTime string `json:"first_login_time"`
|
||||
LastLoginIp string `json:"last_login_ip"`
|
||||
LastLoginTime string `json:"last_login_time"`
|
||||
}
|
||||
|
||||
// CreateGetUserGameSignRequest 获取用户登录过的游戏大类
|
||||
func CreateGetUserGameSignRequest(userName, gameSign, orderBy string) (req *GetUserGameSignRequest) {
|
||||
ts, sign := GetSign()
|
||||
|
||||
req = &GetUserGameSignRequest{
|
||||
RpcRequest: &requests.RpcRequest{},
|
||||
}
|
||||
req.InitWithApiInfo(HOST, VERSION, "/remote_login.php")
|
||||
req.FormParams = map[string]string{
|
||||
"act": "info",
|
||||
"do": "get_user_game_sign",
|
||||
"username": userName,
|
||||
"game_sign": gameSign,
|
||||
"order_by": orderBy,
|
||||
"time": fmt.Sprintf("%v", ts),
|
||||
"sign": sign,
|
||||
}
|
||||
|
||||
req.Method = requests.POST
|
||||
return
|
||||
}
|
||||
|
||||
func CreateGetUserGameSignResponse() (response *GetUserGameSignResponse) {
|
||||
response = &GetUserGameSignResponse{
|
||||
BaseResponse: &responses.BaseResponse{},
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user