From b69ed4b807479aeee2de1092ae28e07573e49ddc Mon Sep 17 00:00:00 2001 From: huangqz Date: Tue, 10 Jun 2025 19:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96iOS?= =?UTF-8?q?=E5=88=87=E6=94=AF=E4=BB=98=E8=A7=84=E5=88=99=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/game/client.go | 7 +++++ services/game/client_test.go | 14 +++++++++ services/game/pay.go | 60 ++++++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 services/game/pay.go diff --git a/services/game/client.go b/services/game/client.go index a8cab2a..b662f25 100644 --- a/services/game/client.go +++ b/services/game/client.go @@ -75,3 +75,10 @@ func (c *Client) GetGameCompany(req *GetGameCompanyReq) (resp *GetGameCompanyRes err = c.DoAction(req, resp) return } + +// GetIsBlockOutIos 获取iOS切支付规则 +func (c *Client) GetIsBlockOutIos(req *IsBlockOutIosReq) (resp *IsBlockOutIosResp, err error) { + resp = CreateIsBlockOutIosResp() + err = c.DoAction(req, resp) + return +} diff --git a/services/game/client_test.go b/services/game/client_test.go index 912d504..8b71299 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -120,3 +120,17 @@ func TestGetGameCompany(t *testing.T) { fmt.Println(gameCompany) fmt.Println(gameCompany.Data.System) } + +func TestIsBlockOutIos(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Error(err) + } + isBlockOutIosReq := CreateIsBlockOutIosReq("ec63860282", 4570, "116.26.129.38", "", 0, 0) + isBlockOutIos, err := client.GetIsBlockOutIos(isBlockOutIosReq) + if err != nil { + t.Error(err) + return + } + t.Log(isBlockOutIos) +} diff --git a/services/game/pay.go b/services/game/pay.go new file mode 100644 index 0000000..f938f0b --- /dev/null +++ b/services/game/pay.go @@ -0,0 +1,60 @@ +package game + +import ( + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" + "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" +) + +// IsBlockOutIosReq +// 获取切支付规则 +type IsBlockOutIosReq struct { + *requests.RpcRequest + UserName string `position:"Body" field:"user_name"` + GameId int64 `position:"Body" field:"appid"` + Ip string `position:"Body" field:"ip"` + Imei string `position:"Body" field:"imei"` + LoginDays int64 `position:"Body" field:"login_days"` + PlayTime int64 `position:"Body" field:"play_time"` +} + +type IsBlockOutIosRespData struct { + PayInChannel bool `json:"pay_in_channel"` + PayInChannelMatchedRule []int64 `json:"pay_in_channel_matched_rule"` + DoDisplayIos bool `json:"do_display_ios"` + DoDisplayIosMatchedRule []int64 `json:"do_display_ios_matched_rule"` + DoDisplayWebsite bool `json:"do_display_website"` + DoDisplayWebsiteMatchedRule []int64 `json:"do_display_website_matched_rule"` + DoDisplayWebsiteWechatInfo string `json:"do_display_website_wechat_info"` + DoWebOrderPay bool `json:"do_web_order_pay"` + DoWebOrderPayMatchedRule []int64 `json:"do_web_order_pay_matched_rule"` + DoWebOrderPayWechatInfo string `json:"do_web_order_pay_wechat_info"` +} + +type IsBlockOutIosResp struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data IsBlockOutIosRespData `json:"data"` +} + +func CreateIsBlockOutIosReq(userName string, gameId int64, ip string, imei string, loginDays, playTime int64) *IsBlockOutIosReq { + req := &IsBlockOutIosReq{ + RpcRequest: &requests.RpcRequest{}, + } + req.UserName = userName + req.GameId = gameId + req.Ip = ip + req.Imei = imei + req.LoginDays = loginDays + req.PlayTime = playTime + req.InitWithApiInfo(HOST, VERSION, "/api/pay/isBlockOutIos") + req.Method = requests.POST + return req +} + +func CreateIsBlockOutIosResp() *IsBlockOutIosResp { + resp := &IsBlockOutIosResp{ + BaseResponse: &responses.BaseResponse{}, + } + return resp +}