From 9aa5924b979377d3b0caeb80d2033f07367c4991 Mon Sep 17 00:00:00 2001 From: yuxh Date: Fri, 25 Jul 2025 17:20:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20game=20=E6=8C=89=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=8E=B7=E5=8F=96=E9=85=8D=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/game/client_test.go | 19 ++++++++++++-- services/game/game.go | 49 +++++++++++++++++++----------------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/services/game/client_test.go b/services/game/client_test.go index 4bcf03e..9594894 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -26,11 +26,11 @@ func TestGetGameInfo(t *testing.T) { if err != nil { panic(err) } - resp, err := client.GetGameInfo(CreateGetGameInfoByIdReq(8362, 1)) + resp, err := client.GetGameInfo(CreateGetGameInfoByIdReq(797, 1)) if err != nil { panic(err) } - fmt.Println(resp.Code, resp.Msg, resp.Data) + fmt.Println(resp.Code, resp.Msg, resp.Data.GameHomeShortImage) } func TestChannelInfo(t *testing.T) { @@ -179,3 +179,18 @@ func TestGetGameRealAuthInfo(t *testing.T) { } t.Log(isBlockOutIos) } + +func TestGetGameVersion(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Error(err) + return + } + req := CreateGetGameVersionReq(8071, "1.0.6") + resp, err := client.GetGameVersion(req) + if err != nil { + t.Error(err) + return + } + t.Log(resp) +} diff --git a/services/game/game.go b/services/game/game.go index 590f39d..e267888 100644 --- a/services/game/game.go +++ b/services/game/game.go @@ -264,29 +264,32 @@ func CreateGetGameCompanyResp() *GetGameCompanyResp { // ==== 获取游戏客户端版本配置 type GameVersion struct { - ID int `json:"id"` - GameID int `json:"game_id"` - GameVersion string `json:"version"` - GameURL string `json:"url"` - PayCallbackURL string `json:"pay_callback_url"` - DomainURL string `json:"domain_url"` - Status int `json:"status"` - H5Version int `json:"h5_version"` - H5Status int `json:"h5_status"` - IsH5Logout int `json:"is_h5_logout"` - HideWindow int `json:"hidewindow"` - PayInfo PayInfo `json:"pay_display_info"` - IsYsdk int `json:"is_ysdk"` - CheckVerified int `json:"check_verified"` - Company string `json:"company"` - CompanyKf string `json:"company_kf"` - CompanyProto string `json:"company_proto"` - CompanySms string `json:"company_sms"` - KfStatus int `json:"kf_status"` - PopupTime int `json:"popup_time"` - ExtData map[string]any `json:"ext_data"` - VersionStatus int `json:"version_status"` - VersionTime int `json:"version_time"` + ID int `json:"id"` + GameID int `json:"game_id"` + GameVersion string `json:"version"` + GameURL string `json:"url"` + PayCallbackURL string `json:"pay_callback_url"` + DomainURL string `json:"domain_url"` + Status int `json:"status"` + H5Version int `json:"h5_version"` + H5Status int `json:"h5_status"` + IsH5Logout int `json:"is_h5_logout"` + HideWindow int `json:"hidewindow"` + PayInfo PayInfo `json:"pay_display_info"` + IsYsdk int `json:"is_ysdk"` + CheckVerified int `json:"check_verified"` + Company string `json:"company"` + CompanyKf string `json:"company_kf"` + CompanyProto string `json:"company_proto"` + CompanySms string `json:"company_sms"` + KfStatus int `json:"kf_status"` + PopupTime int `json:"popup_time"` + ExtData map[string]any `json:"ext_data"` + VersionStatus int `json:"version_status"` + VersionTime int `json:"version_time"` + RequestDomain string `json:"request_domain"` + SpareRequestDomain string `json:"spare_request_domain"` + OtherRequestDomain string `json:"other_request_domain"` } type GetGameVersionReq struct {