7
0

【www服务】查询子游戏简单列表

This commit is contained in:
liguanjie 2025-05-28 17:57:52 +08:00
parent 9591e794f0
commit 7dc4a177f9
3 changed files with 64 additions and 1 deletions

View File

@ -6,7 +6,7 @@ import (
)
const (
VERSION = "2025-04-27"
VERSION = "2025-05-28"
)
var HOST = requests.Host{
@ -54,3 +54,8 @@ func (c *Client) GetProtocolByGameId(req *GetProtocolByGameIdRep) (resp *GetProt
err = c.DoAction(req, resp)
return
}
func (c *Client) GetGameSimpleList(req *GetGameSimpleListReq) (resp *GetGameSimpleListResp, err error) {
resp = CreateGetGameSimpleListResp()
err = c.DoAction(req, resp)
return
}

View File

@ -77,3 +77,17 @@ func TestGetProtocolByGameId(t *testing.T) {
}
fmt.Println(info)
}
func TestGetGameSimpleList(t *testing.T) {
client, err := NewClient()
if err != nil {
panic(err)
}
req := CreateGetGameSimpleListReq("8071,8062", "")
info, err := client.GetGameSimpleList(req)
if err != nil {
t.Error(err)
return
}
fmt.Println(info)
}

View File

@ -162,3 +162,47 @@ func CreateGetGameInfoByIdResp() *GetGameInfoResp {
BaseResponse: &responses.BaseResponse{},
}
}
type GetGameSimpleListReq struct {
*requests.RpcRequest
}
type GetGameSimpleListResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data map[string]GameSimple `json:"data"`
}
type GameSimple struct {
ID int `json:"id"`
Name string `json:"name"`
GameSign string `json:"game_sign"`
}
// CreateGetGameSimpleListReq
// gids 子游戏字符串多个子游戏id用英文逗号分割
// game_signs 根游戏标识字符串,多个标识用英文逗号分割
func CreateGetGameSimpleListReq(gameIds string, gameSigns string) *GetGameSimpleListReq {
req := &GetGameSimpleListReq{
RpcRequest: &requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, "/api/game/getSimpleList")
tmpParams := make(map[string]string)
if gameIds != "" {
tmpParams["gids"] = gameIds
}
if gameSigns != "" {
tmpParams["game_signs"] = gameSigns
}
req.FormParams = tmpParams
req.Method = requests.POST
return req
}
func CreateGetGameSimpleListResp() *GetGameSimpleListResp {
return &GetGameSimpleListResp{
BaseResponse: &responses.BaseResponse{},
}
}