7
0

创建同步到游戏中心请求优化

This commit is contained in:
许 洋 2025-03-28 14:13:59 +08:00
parent 4a8d29f57f
commit 3c00a77149

View File

@ -2,13 +2,13 @@ package script
import ( import (
"encoding/json" "encoding/json"
"fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
) )
type OpenGameReq struct { type OpenGameReq struct {
*requests.RpcRequest *requests.RpcRequest
GameID int `position:"Query" field:"game_id"`
} }
type OpenGameResp struct { type OpenGameResp struct {
@ -25,10 +25,11 @@ func (baseResponse *OpenGameResp) GetHttpContentBytes() []byte {
func CreateOpenGameReq(gameId int) *OpenGameReq { func CreateOpenGameReq(gameId int) *OpenGameReq {
req := &OpenGameReq{ req := &OpenGameReq{
&requests.RpcRequest{}, &requests.RpcRequest{},
gameId,
} }
req.InitWithApiInfo(HOST, VERSION, "open_game.php?game_id="+fmt.Sprintf("%v", gameId)) req.InitWithApiInfo(HOST, VERSION, "open_game.php")
req.Method = requests.POST req.Method = requests.GET
return req return req
} }