Compare commits
No commits in common. "e0a30e60407f307a9560b47416fcb1a61a691bcf" and "1f0bfefcfcec1990b62012c1048bd670e0202eb9" have entirely different histories.
e0a30e6040
...
1f0bfefcfc
@ -170,14 +170,6 @@ func (c *Client) GetGameRoleName(req *GetGameRoleNameReq) (response *GetGameRole
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGameRoleInfo
|
|
||||||
// 获取游戏角色信息
|
|
||||||
func (c *Client) GetGameRoleInfo(req *GetGameRoleInfoReq) (response *GetGameRoleInfoResp, err error) {
|
|
||||||
response = CreateGetGameRoleInfoResp()
|
|
||||||
err = c.DoAction(req, response)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetAnchorUser
|
// GetAnchorUser
|
||||||
// 获取主播信息接口
|
// 获取主播信息接口
|
||||||
func (c *Client) GetAnchorUser(req *GetAnchorUserReq) (resp *GetAnchorUserResp, err error) {
|
func (c *Client) GetAnchorUser(req *GetAnchorUserReq) (resp *GetAnchorUserResp, err error) {
|
||||||
|
|||||||
@ -529,8 +529,6 @@ func CreateGetLoginBgResp() *GetLoginBgResp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGameRoleNameReq
|
|
||||||
// 该接口response格式不统一慎用,请求hlhj的数据,返回的数据格式又是另一种
|
|
||||||
type GetGameRoleNameReq struct {
|
type GetGameRoleNameReq struct {
|
||||||
*requests.RpcRequest
|
*requests.RpcRequest
|
||||||
AppId int64 `position:"Body" field:"appid"`
|
AppId int64 `position:"Body" field:"appid"`
|
||||||
@ -597,67 +595,6 @@ func CreateGetGameRoleNameResp() *GetGameRoleNameResp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGameRoleInfoResp
|
|
||||||
// 统一获取角色信息接口,getGameRoleInfo 接口对response格式做了统一处理
|
|
||||||
type GetGameRoleInfoResp struct {
|
|
||||||
*responses.BaseResponse
|
|
||||||
Code int `json:"code"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Data struct {
|
|
||||||
UserInfo []GetGameRoleInfoDataRoleItem `json:"userinfo"`
|
|
||||||
} `json:"data"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameRoleInfoDataRoleItem struct {
|
|
||||||
RoleId string `json:"roleId"`
|
|
||||||
Name string `json:"name"`
|
|
||||||
Server int64 `json:"server"`
|
|
||||||
ServerName string `json:"serverName"`
|
|
||||||
Level int64 `json:"level"`
|
|
||||||
VipLevel int64 `json:"vipLevel"`
|
|
||||||
CreateTime int64 `json:"createTime"`
|
|
||||||
RoleLevelUpdateTime int64 `json:"roleLevelUpdateTime"`
|
|
||||||
Power int64 `json:"power"`
|
|
||||||
Profession string `json:"profession"`
|
|
||||||
ZhuanshengLv int64 `json:"zhuansheng_lv"`
|
|
||||||
ZhuanshengName string `json:"zhuanshengName"`
|
|
||||||
Gold int64 `json:"gold"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetGameRoleInfoReq struct {
|
|
||||||
*requests.RpcRequest
|
|
||||||
AppId int64 `position:"Body" field:"appid"`
|
|
||||||
UserId int64 `position:"Body" field:"uid"`
|
|
||||||
UserName string `position:"Body" field:"user_name"`
|
|
||||||
ServerId int64 `position:"Body" field:"server_id"`
|
|
||||||
Time int64 `position:"Body" field:"time"`
|
|
||||||
Sign string `position:"Body" field:"sign"`
|
|
||||||
Os int64 `position:"Body" field:"os"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameRoleInfoReq(gameId, sid, uid, os int64, nameName string) *GetGameRoleInfoReq {
|
|
||||||
ts := time.Now().Unix()
|
|
||||||
req := &GetGameRoleInfoReq{
|
|
||||||
RpcRequest: &requests.RpcRequest{},
|
|
||||||
AppId: gameId,
|
|
||||||
UserName: nameName,
|
|
||||||
ServerId: sid,
|
|
||||||
UserId: uid,
|
|
||||||
Time: ts,
|
|
||||||
Sign: utils.Md5(fmt.Sprintf("%d%d%s", gameId, ts, gameKey)),
|
|
||||||
Os: os,
|
|
||||||
}
|
|
||||||
req.InitWithApiInfo(HOST, VERSION, "/api/game/getGameRoleInfo")
|
|
||||||
req.Method = requests.POST
|
|
||||||
return req
|
|
||||||
}
|
|
||||||
|
|
||||||
func CreateGetGameRoleInfoResp() *GetGameRoleInfoResp {
|
|
||||||
return &GetGameRoleInfoResp{
|
|
||||||
BaseResponse: &responses.BaseResponse{},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetSdkThemeReq struct {
|
type GetSdkThemeReq struct {
|
||||||
*requests.RpcRequest
|
*requests.RpcRequest
|
||||||
GameId int64 `position:"Query" field:"game_id" default:"-" `
|
GameId int64 `position:"Query" field:"game_id" default:"-" `
|
||||||
|
|||||||
@ -1,22 +0,0 @@
|
|||||||
package game
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 测试 /api/game/getGameRoleInfo 接口
|
|
||||||
func TestGetGameRoleInfo(t *testing.T) {
|
|
||||||
roleReq := CreateGetGameRoleInfoReq(3706, 1373, 0, 0, "13924600328")
|
|
||||||
roleReq.SetReadTimeout(10 * time.Minute)
|
|
||||||
|
|
||||||
client, _ := NewClient()
|
|
||||||
response, err := client.GetGameRoleInfo(roleReq)
|
|
||||||
if err != nil {
|
|
||||||
t.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
_ = response
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user