From 5f5a1160bf2a158ab921a9eed244b01c5bc9df03 Mon Sep 17 00:00:00 2001 From: xuyang Date: Mon, 7 Jul 2025 16:26:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1v2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sms/client.go | 16 ++++++++++++++ services/sms/client_test.go | 28 ++++++++++++++++++++++++ services/sms/sms.go | 43 +++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) diff --git a/services/sms/client.go b/services/sms/client.go index 0885e07..f88e3bd 100644 --- a/services/sms/client.go +++ b/services/sms/client.go @@ -88,6 +88,22 @@ func (c *Client) SendSms(req *SendSmsRequest) (resp *SendSmsResponse, err error) return } +func (c *Client) SendSmsV2(req *SendSmsRequestV2) (resp *SendSmsResponseV2, err error) { + + if req.Mobile == "" { + err = errors.New("mobile is empty") + return + } + + if req.Type == "" { + err = errors.New("type is empty") + return + } + resp = CreateSendSmsResponseV2() + err = c.DoAction(req, resp) + return +} + func getToken(key string) (ts int64, token string) { ts = time.Now().Unix() hash := md5.New() diff --git a/services/sms/client_test.go b/services/sms/client_test.go index bd7cabb..d06db1c 100644 --- a/services/sms/client_test.go +++ b/services/sms/client_test.go @@ -1,6 +1,7 @@ package sms import ( + "encoding/json" "fmt" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "testing" @@ -140,3 +141,30 @@ func TestClient_SendSmsUrl(t *testing.T) { fmt.Println(sms) } + +func TestClient_SendSmsCodeV2(t *testing.T) { + req := CreateSendSmsRequestV2(SendSmsParamV2{ + Mobile: "18320021439", + Type: SmsTypeBindPhone, + Replaces: []Item{{ + Key: ReplaceKeyCode, + Value: "6379", + }, { + Key: ReplaceKeySecond, + Value: "120", + }}, + Company: "", + Ip: "192.168.1.103", + }) + + sms, err := client.SendSmsV2(req) + if err != nil { + panic(err) + } + + marshal, err := json.Marshal(sms) + if err != nil { + panic(err) + } + fmt.Println(string(marshal)) +} diff --git a/services/sms/sms.go b/services/sms/sms.go index 35beb37..74ade7f 100644 --- a/services/sms/sms.go +++ b/services/sms/sms.go @@ -29,6 +29,20 @@ type SendSmsResponse struct { *responses.BaseResponse } +type SendSmsRequestV2 struct { + *requests.JsonRequest + Mobile string `position:"Json" field:"mobile"` + Type string `position:"Json" field:"type"` + Replaces []Item `position:"Json" field:"replaces"` + Company string `position:"Json" field:"company"` + Ip string `position:"Json" field:"ip"` +} + +type SendSmsResponseV2 struct { + *responses.BaseResponse + TraceID string `json:"trace_id"` +} + type SmsType = string const ( @@ -44,6 +58,14 @@ type SendSmsParam struct { Replaces []Item } +type SendSmsParamV2 struct { + Mobile string // 手机号 + Type SmsType // 验证码类型 + Replaces []Item + Company string // 子游戏公司主体 + Ip string // ip +} + func CreateSendSmsRequest(param SendSmsParam) (req *SendSmsRequest) { req = &SendSmsRequest{ JsonRequest: &requests.JsonRequest{}, @@ -62,3 +84,24 @@ func CreateSendSmsResponse() (resp *SendSmsResponse) { } return } + +func CreateSendSmsRequestV2(param SendSmsParamV2) (req *SendSmsRequestV2) { + req = &SendSmsRequestV2{ + JsonRequest: &requests.JsonRequest{}, + Mobile: param.Mobile, + Type: param.Type, + Replaces: param.Replaces, + Company: param.Company, + Ip: param.Ip, + } + req.InitWithApiInfo(HOST, VERSION, "/v1/sms/send") + req.Method = requests.POST + return +} + +func CreateSendSmsResponseV2() (resp *SendSmsResponseV2) { + resp = &SendSmsResponseV2{ + BaseResponse: &responses.BaseResponse{}, + } + return +} From 66eb586d88e7bb41a6ec8872a6609ecbc0a5cfc2 Mon Sep 17 00:00:00 2001 From: xuyang Date: Mon, 7 Jul 2025 16:40:10 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=9F=AD=E4=BF=A1v2=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/sms/client.go | 4 ++-- services/sms/client_test.go | 4 ++-- services/sms/sms.go | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/sms/client.go b/services/sms/client.go index f88e3bd..4a65d14 100644 --- a/services/sms/client.go +++ b/services/sms/client.go @@ -90,8 +90,8 @@ func (c *Client) SendSms(req *SendSmsRequest) (resp *SendSmsResponse, err error) func (c *Client) SendSmsV2(req *SendSmsRequestV2) (resp *SendSmsResponseV2, err error) { - if req.Mobile == "" { - err = errors.New("mobile is empty") + if req.Phone == "" { + err = errors.New("phone is empty") return } diff --git a/services/sms/client_test.go b/services/sms/client_test.go index d06db1c..060f011 100644 --- a/services/sms/client_test.go +++ b/services/sms/client_test.go @@ -144,8 +144,8 @@ func TestClient_SendSmsUrl(t *testing.T) { func TestClient_SendSmsCodeV2(t *testing.T) { req := CreateSendSmsRequestV2(SendSmsParamV2{ - Mobile: "18320021439", - Type: SmsTypeBindPhone, + Phone: "18320021439", + Type: SmsTypeRegister, Replaces: []Item{{ Key: ReplaceKeyCode, Value: "6379", diff --git a/services/sms/sms.go b/services/sms/sms.go index 74ade7f..a362aa5 100644 --- a/services/sms/sms.go +++ b/services/sms/sms.go @@ -31,7 +31,7 @@ type SendSmsResponse struct { type SendSmsRequestV2 struct { *requests.JsonRequest - Mobile string `position:"Json" field:"mobile"` + Phone string `position:"Json" field:"phone"` Type string `position:"Json" field:"type"` Replaces []Item `position:"Json" field:"replaces"` Company string `position:"Json" field:"company"` @@ -59,7 +59,7 @@ type SendSmsParam struct { } type SendSmsParamV2 struct { - Mobile string // 手机号 + Phone string // 手机号 Type SmsType // 验证码类型 Replaces []Item Company string // 子游戏公司主体 @@ -88,13 +88,13 @@ func CreateSendSmsResponse() (resp *SendSmsResponse) { func CreateSendSmsRequestV2(param SendSmsParamV2) (req *SendSmsRequestV2) { req = &SendSmsRequestV2{ JsonRequest: &requests.JsonRequest{}, - Mobile: param.Mobile, + Phone: param.Phone, Type: param.Type, Replaces: param.Replaces, Company: param.Company, Ip: param.Ip, } - req.InitWithApiInfo(HOST, VERSION, "/v1/sms/send") + req.InitWithApiInfo(HOST, VERSION, "/v2/sms/send") req.Method = requests.POST return } From 68a9435cb7a99b7f294ee17d0f2fa8fe9d782193 Mon Sep 17 00:00:00 2001 From: huangqz Date: Thu, 10 Jul 2025 11:42:07 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=85=A8=E5=B1=80=E9=85=8D=E7=BD=AE=E6=8E=A5?= =?UTF-8?q?=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 | 15 +++++++++++++++ services/game/game.go | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) 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{}, + } +} From d2c5d53aba5c6ccfc8ce4d832932ffefdf1827c0 Mon Sep 17 00:00:00 2001 From: huangqz Date: Thu, 10 Jul 2025 15:45:07 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=AE=9E=E5=90=8D=E9=BB=91=E5=90=8D=E5=8D=95=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 | 15 ++++++++++++++ services/game/game.go | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) diff --git a/services/game/client.go b/services/game/client.go index e701776..54d2476 100644 --- a/services/game/client.go +++ b/services/game/client.go @@ -95,3 +95,10 @@ func (c *Client) GetConfig(req *GetConfigReq) (resp *GetConfigResp, err error) { err = c.DoAction(req, resp) return } + +// GetRealAuthBlackList 获取实名黑名单 +func (c *Client) GetRealAuthBlackList(req *GetRealAuthBlackListReq) (resp *GetRealAuthBlackListResp, err error) { + resp = CreateGetRealAuthBlackListResp() + err = c.DoAction(req, resp) + return +} diff --git a/services/game/client_test.go b/services/game/client_test.go index 7f2ff9d..b7ee7f8 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -149,3 +149,18 @@ func TestGetConfig(t *testing.T) { } t.Log(isBlockOutIos) } + +// 获取实名黑名单 +func TestGetRealAuthBlackList(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Error(err) + } + getRealAuthBlackListReq := CreateGetRealAuthBlackListReq() + isBlockOutIos, err := client.GetRealAuthBlackList(getRealAuthBlackListReq) + if err != nil { + t.Error(err) + return + } + t.Log(isBlockOutIos) +} diff --git a/services/game/game.go b/services/game/game.go index e8ba4f1..86eb9f0 100644 --- a/services/game/game.go +++ b/services/game/game.go @@ -350,3 +350,43 @@ func CreateGetConfigResp() *GetConfigResp { BaseResponse: &responses.BaseResponse{}, } } + +// GetRealAuthBlackListReq +// 获取实名黑名单 +type GetRealAuthBlackListReq struct { + *requests.RpcRequest + Key string `position:"Query" field:"key" default:"-" ` +} + +type GetRealAuthBlackListRespDataItem struct { + Id int `json:"id"` + TrueName string `json:"true_name"` + IdCard string `json:"id_card"` + Remark string `json:"remark"` + CreateBy string `json:"create_by"` + UpdateBy string `json:"update_by"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` +} + +type GetRealAuthBlackListResp struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data []GetRealAuthBlackListRespDataItem `json:"data"` +} + +func CreateGetRealAuthBlackListReq() *GetRealAuthBlackListReq { + req := &GetRealAuthBlackListReq{ + RpcRequest: &requests.RpcRequest{}, + } + req.InitWithApiInfo(HOST, VERSION, "/api/game/getRealAuthBlackList") + req.Method = requests.GET + return req +} + +func CreateGetRealAuthBlackListResp() *GetRealAuthBlackListResp { + return &GetRealAuthBlackListResp{ + BaseResponse: &responses.BaseResponse{}, + } +} From 2622e7c3c97e098cdbafd4525037b7bf7541da81 Mon Sep 17 00:00:00 2001 From: huangqz Date: Thu, 10 Jul 2025 18:05:09 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=9E=E5=90=8D=E8=AE=A4=E8=AF=81=E5=8F=82=E6=95=B0=E6=8E=A5?= =?UTF-8?q?=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 | 15 +++++++++++++ services/game/game.go | 43 ++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/services/game/client.go b/services/game/client.go index 54d2476..8708394 100644 --- a/services/game/client.go +++ b/services/game/client.go @@ -102,3 +102,10 @@ func (c *Client) GetRealAuthBlackList(req *GetRealAuthBlackListReq) (resp *GetRe err = c.DoAction(req, resp) return } + +// GetGameRealAuthInfo 获取实名参数 +func (c *Client) GetGameRealAuthInfo(req *GetGameRealAuthInfoReq) (resp *GetGameRealAuthInfoResp, err error) { + resp = CreateGetGameRealAuthInfoResp() + err = c.DoAction(req, resp) + return +} diff --git a/services/game/client_test.go b/services/game/client_test.go index b7ee7f8..ecdcc8f 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -164,3 +164,18 @@ func TestGetRealAuthBlackList(t *testing.T) { } t.Log(isBlockOutIos) } + +// 获取实名黑名单 +func TestGetGameRealAuthInfo(t *testing.T) { + client, err := NewClient() + if err != nil { + t.Error(err) + } + getGameRealAuthInfoReq := CreateGetGameRealAuthInfoReq(7081) + isBlockOutIos, err := client.GetGameRealAuthInfo(getGameRealAuthInfoReq) + if err != nil { + t.Error(err) + return + } + t.Log(isBlockOutIos) +} diff --git a/services/game/game.go b/services/game/game.go index 86eb9f0..c59bffe 100644 --- a/services/game/game.go +++ b/services/game/game.go @@ -390,3 +390,46 @@ func CreateGetRealAuthBlackListResp() *GetRealAuthBlackListResp { BaseResponse: &responses.BaseResponse{}, } } + +// GetGameRealAuthInfoReq +// 获取实名参数 +type GetGameRealAuthInfoReq struct { + *requests.RpcRequest + GameId int64 `position:"Body" field:"game_id" default:"-" ` +} + +type GetGameRealAuthInfoResp struct { + *responses.BaseResponse + Code int `json:"code"` + Msg string `json:"msg"` + Data struct { + GroupName string `json:"group_name"` + GroupDescription int `json:"group_description"` + VerifiedTime string `json:"verified_time"` + AreaProvince string `json:"area_province"` + VersionInfo string `json:"version_info"` + IsReal int `json:"is_real"` + IsDirect int `json:"is_direct"` + AuthChannel string `json:"auth_channel"` + StandbyAuthChannel string `json:"standby_auth_channel"` + ProtectTime int `json:"protect_time"` + GovIoReport int `json:"gov_io_report"` + MinorBan int `json:"minor_ban"` + } `json:"data"` +} + +func CreateGetGameRealAuthInfoReq(gameId int64) *GetGameRealAuthInfoReq { + req := &GetGameRealAuthInfoReq{ + RpcRequest: &requests.RpcRequest{}, + GameId: gameId, + } + req.InitWithApiInfo(HOST, VERSION, "/api/login/getGameRealAuthInfo") + req.Method = requests.POST + return req +} + +func CreateGetGameRealAuthInfoResp() *GetGameRealAuthInfoResp { + return &GetGameRealAuthInfoResp{ + BaseResponse: &responses.BaseResponse{}, + } +} From d283be207b09126fdec900ce3172d2cbdeb3f7ac Mon Sep 17 00:00:00 2001 From: huangqz Date: Thu, 10 Jul 2025 18:26:12 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E5=AE=9E=E5=90=8D=E5=8F=82=E6=95=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/game/client_test.go | 2 +- services/game/game.go | 34 ++++++++++++++++++---------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/services/game/client_test.go b/services/game/client_test.go index ecdcc8f..4bcf03e 100644 --- a/services/game/client_test.go +++ b/services/game/client_test.go @@ -165,7 +165,7 @@ func TestGetRealAuthBlackList(t *testing.T) { t.Log(isBlockOutIos) } -// 获取实名黑名单 +// 获取游戏实名参数 func TestGetGameRealAuthInfo(t *testing.T) { client, err := NewClient() if err != nil { diff --git a/services/game/game.go b/services/game/game.go index c59bffe..efa199f 100644 --- a/services/game/game.go +++ b/services/game/game.go @@ -398,24 +398,26 @@ type GetGameRealAuthInfoReq struct { GameId int64 `position:"Body" field:"game_id" default:"-" ` } +type GetGameRealAuthInfoRespData struct { + GroupName string `json:"group_name"` + GroupDescription int `json:"group_description"` + VerifiedTime string `json:"verified_time"` + AreaProvince string `json:"area_province"` + VersionInfo string `json:"version_info"` + IsReal int `json:"is_real"` + IsDirect int `json:"is_direct"` + AuthChannel string `json:"auth_channel"` + StandbyAuthChannel string `json:"standby_auth_channel"` + ProtectTime int `json:"protect_time"` + GovIoReport int `json:"gov_io_report"` + MinorBan int `json:"minor_ban"` +} + type GetGameRealAuthInfoResp struct { *responses.BaseResponse - Code int `json:"code"` - Msg string `json:"msg"` - Data struct { - GroupName string `json:"group_name"` - GroupDescription int `json:"group_description"` - VerifiedTime string `json:"verified_time"` - AreaProvince string `json:"area_province"` - VersionInfo string `json:"version_info"` - IsReal int `json:"is_real"` - IsDirect int `json:"is_direct"` - AuthChannel string `json:"auth_channel"` - StandbyAuthChannel string `json:"standby_auth_channel"` - ProtectTime int `json:"protect_time"` - GovIoReport int `json:"gov_io_report"` - MinorBan int `json:"minor_ban"` - } `json:"data"` + Code int `json:"code"` + Msg string `json:"msg"` + Data GetGameRealAuthInfoRespData `json:"data"` } func CreateGetGameRealAuthInfoReq(gameId int64) *GetGameRealAuthInfoReq {