diff --git a/services/game/client.go b/services/game/client.go index b61f964..e701776 100644 --- a/services/game/client.go +++ b/services/game/client.go @@ -88,3 +88,10 @@ func (c *Client) GetGameVersion(req *GetGameVersionReq) (resp *GetGameVersionRes err = c.DoAction(req, resp) return } + +// GetConfig 获取游戏全局配置 +func (c *Client) GetConfig(req *GetConfigReq) (resp *GetConfigResp, err error) { + resp = CreateGetConfigResp() + err = c.DoAction(req, resp) + return +} diff --git a/services/game/client_test.go b/services/game/client_test.go index 8b71299..7f2ff9d 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -134,3 +134,18 @@ func TestIsBlockOutIos(t *testing.T) { } t.Log(isBlockOutIos) } + +// 获取游戏全局配置 +func TestGetConfig(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Error(err) + } + getConfigReq := CreateGetConfigReq("overlord_act_config") + isBlockOutIos, err := client.GetConfig(getConfigReq) + if err != nil { + t.Error(err) + return + } + t.Log(isBlockOutIos) +} diff --git a/services/game/game.go b/services/game/game.go index 6d42791..e8ba4f1 100644 --- a/services/game/game.go +++ b/services/game/game.go @@ -315,3 +315,38 @@ func CreateGetGameVersionResp() *GetGameVersionResp { BaseResponse: &responses.BaseResponse{}, } } + +// GetConfigReq +// 游戏全局配置 +type GetConfigReq struct { + *requests.RpcRequest + Key string `position:"Query" field:"key" default:"-" ` +} + +type GetConfigRespData struct { + Id int `json:"id"` + Key string `json:"key"` + ExtData string `json:"ext_data"` +} +type GetConfigResp struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data GetConfigRespData `json:"data"` +} + +func CreateGetConfigReq(key string) *GetConfigReq { + req := &GetConfigReq{ + RpcRequest: &requests.RpcRequest{}, + } + req.Key = key + req.InitWithApiInfo(HOST, VERSION, "/api/game/getConfig") + req.Method = requests.GET + return req +} + +func CreateGetConfigResp() *GetConfigResp { + return &GetConfigResp{ + BaseResponse: &responses.BaseResponse{}, + } +}