From 66eb586d88e7bb41a6ec8872a6609ecbc0a5cfc2 Mon Sep 17 00:00:00 2001 From: xuyang Date: Mon, 7 Jul 2025 16:40:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=91=E9=80=81=E7=9F=AD?= =?UTF-8?q?=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 }