3 Commits

Author SHA1 Message Date
yuguojian
3676395e9f Merge remote-tracking branch 'origin/feature/对接新供应链-唯品尚' 2025-06-20 15:53:30 +08:00
zhongqiang
2fd998b52d 对接新供应链-唯品尚 2025-06-20 15:51:48 +08:00
lzh
2e8f0cb3f2 sms_tool 2025-06-20 14:49:45 +08:00
3 changed files with 13 additions and 5 deletions

View File

@@ -70,7 +70,15 @@ func (c *SmsClient) GetCode(ctx context.Context, key string) (code string, err e
if err != nil {
return "", err
}
return value.(string), nil
if value == nil {
return "", errors.New("验证码不存在,请重新发送")
}
switch value.(type) {
case string:
return value.(string), nil
default:
return "", errors.New("验证码类型错误,请联系管理员")
}
}
// SaveCode 保存验证码

View File

@@ -33,7 +33,7 @@ func (w *WeiPinShangClient) GetManyPostage(getManyPostageReq *GetManyPostageReq)
fmt.Println("getManyPostageReq", getManyPostageReq)
paramMap := make(map[string]any)
paramMap["goodInfo"] = getManyPostageReq.GoodsInfo
paramMap["goodsInfo"] = getManyPostageReq.GoodsInfo
paramMap["address"] = getManyPostageReq.Address
paramMap["province"] = getManyPostageReq.Province
paramMap["county"] = getManyPostageReq.County

View File

@@ -29,7 +29,7 @@ func TestWeiPinShangClient_GetManyPostage(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: GetManyPostageReq{
GoodsInfo: "[{\"goodsId\":\"WPS592_00019\",\"goodSpecId\":\"WPS592_1105165115160944\",\"num\":1},{\"goodsId\":\"WPS505_00007\",\"goodSpecId\":\"WPS505_1007111249857536\",\"num\":1}]",
GoodsInfo: "[{\"goodsId\":\"WPS427_adf0008\",\"goodSpecId\":\"WPS427_0715110641454716\",\"num\":1}]",
Province: "广东省",
Address: "奥园",
City: "广州市",
@@ -80,14 +80,14 @@ func TestWeiPinShangClient_PreOrder(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: PreOrderReq{
GoodsInfo: "[{\"goodsId\":\"WPS2_1231155626421463\",\"goodSpecId\":\"WPS2_12311556265677476\",\"num\":1}]",
GoodsInfo: "[{\"goodsId\":\"WPS427_adf0008\",\"goodSpecId\":\"WPS427_0715110641454716\",\"num\":1}]",
Province: "广东省",
Address: "奥园",
City: "广州市",
Area: "番禺区",
ConsigneePhone: "15375390426",
ConsigneeContacts: "张三",
LockCode: "L100000004",
LockCode: "L100000005",
Source: "AILEHUI",
},
},