7
0

新增game getGameClientInfo接口

This commit is contained in:
huangqz 2025-12-17 16:55:03 +08:00
parent 32e21d0594
commit 791e916418
3 changed files with 68 additions and 0 deletions

View File

@ -138,3 +138,12 @@ func (c *Client) GetLabelListByCate(req *GetLabelListByCateRep) (response *GetLa
err = c.DoAction(req, response)
return
}
// GetGameClientInfo
// 获取游戏版本信息
func (c *Client) GetGameClientInfo(gameId, status int64) (response *ClientInfoResp, err error) {
clientInfoReq := CreateClientInfoReq(status, gameId)
response = CreateClientInfoResp()
err = c.DoAction(clientInfoReq, response)
return
}

View File

@ -241,3 +241,17 @@ func TestGetLoginBg(t *testing.T) {
}
t.Log(getLoginBgResp)
}
func TestGetGameClientInfo(t *testing.T) {
client, err := NewClient()
if err != nil {
t.Log(err)
return
}
resp, err := client.GetGameClientInfo(8961, 4)
if err != nil {
t.Log(err)
return
}
_ = resp
}

View File

@ -0,0 +1,45 @@
package game
import (
"fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
)
type ClientInfoReq struct {
*requests.RpcRequest
}
type ClientInfoResp struct {
*responses.BaseResponse
Code int `json:"code"`
Msg string `json:"msg"`
Data []ClientInfoDataItem `json:"data"`
}
type ClientInfoDataItem struct {
Id int `json:"id"`
GameName string `json:"game_name"`
Status int `json:"status"`
Version string `json:"version"`
GameId int `json:"game_id"`
RequestDomain string `json:"request_domain"`
SpareRequestDomain string `json:"spare_request_domain"`
OtherRequestDomain string `json:"other_request_domain"`
}
func CreateClientInfoReq(status, gameId int64) *ClientInfoReq {
req := &ClientInfoReq{
&requests.RpcRequest{},
}
req.InitWithApiInfo(HOST, VERSION, fmt.Sprintf("/api/game/getGameClientInfo?game_id=%d&status=%d", gameId, status))
req.Method = requests.GET
return req
}
func CreateClientInfoResp() *ClientInfoResp {
return &ClientInfoResp{
BaseResponse: &responses.BaseResponse{},
}
}