Compare commits

..

6 Commits

Author SHA1 Message Date
yuguojian
e41a3c8600 Merge branch 'feature/对接新供应链-唯品尚' 2025-06-18 16:25:01 +08:00
zhongqiang
ebe8aff954 对接新供应链-唯品尚 2025-06-18 16:21:45 +08:00
yuguojian
3d62321146 Merge branch 'feature/对接新供应链-唯品尚' 2025-06-18 16:15:02 +08:00
zhongqiang
12e627aac6 对接新供应链-唯品尚 2025-06-18 16:10:22 +08:00
zhongqiang
842e6d94aa 对接新供应链-唯品尚 2025-06-18 16:09:08 +08:00
zhongqiang
9e328b469b 对接新供应链-唯品尚 2025-06-18 10:12:07 +08:00
3 changed files with 16 additions and 12 deletions

View File

@ -33,11 +33,11 @@ type CreateOrderData struct {
}
type SkuData struct {
GoodSpecId string `json:"goodSpecId"` //商品ID(c_goods_id)
GoodsId string `json:"goodsId"` //商品ID(c_father_goods_id)
GoodName string `json:"goodName"` //商品名称
//Num string `json:"num"` //数量
Num int `json:"num"` //数量
GoodSpecId string `json:"goodSpecId"` //商品ID(c_goods_id)
GoodsId string `json:"goodsId"` //商品ID(c_father_goods_id)
GoodName string `json:"goodName"` //商品名称
Num interface{} `json:"num"` //数量
//Num int `json:"num"` //数量
Price string `json:"price"` //单价
}

View File

@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"io"
"log"
"net/http"
"strings"
)
@ -268,6 +269,7 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res []
if err != nil {
return
}
//req.Proto = "HTTP/2"
req.Header.Set("Content-Type", "application/json")
req.Header.Set("channelType", w.ChannelType)
@ -276,13 +278,15 @@ func (w *WeiPinShangClient) WPSPost(url string, paramMap map[string]any) (res []
return
}
req.Header.Set("md5", sign)
//log.Printf("WPSPost req: %+v\n", req)
// 创建 HTTP 客户端
client := &http.Client{}
//log.Printf("WPSPost client: %+v\n", client)
// 发送请求
resp, err := client.Do(req)
//log.Printf("WPSPost resp: %+v\n", resp)
if err != nil {
log.Printf("发送请求失败: %+v\n", err)
return
}
defer func(Body io.ReadCloser) {

View File

@ -80,14 +80,14 @@ func TestWeiPinShangClient_PreOrder(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: PreOrderReq{
GoodsInfo: "[{\"goodsId\":\"WPS9_282520\",\"goodSpecId\":\"WPS9_1221183858889276\",\"num\":2}]",
GoodsInfo: "[{\"goodsId\":\"WPS2_1231155626421463\",\"goodSpecId\":\"WPS2_12311556265677476\",\"num\":1}]",
Province: "广东省",
Address: "奥园",
City: "广州市",
Area: "番禺区",
ConsigneePhone: "15375390426",
ConsigneeContacts: "张三",
LockCode: "L100000000",
LockCode: "L100000004",
Source: "AILEHUI",
},
},
@ -135,8 +135,8 @@ func TestWeiPinShangClient_CreateOrder(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: CreateOrderReq{
LockCode: "L100000000",
OrderNo: "30000000000",
LockCode: "L100000004",
OrderNo: "2000000004",
},
},
}
@ -292,7 +292,7 @@ func TestWeiPinShangClient_GetOrderInfoByThirdNO(t *testing.T) {
Key: "f654ea5bde7635c3f46191191e5c4c8e",
},
args: args{
orderNo: "570872619444771455",
orderNo: "570853643339733632",
},
},
}