mirror of
https://github.com/xxjwxc/public.git
synced 2025-09-26 20:01:19 +08:00
new
This commit is contained in:
@@ -28,4 +28,5 @@ type KdnLogistics struct {
|
||||
type kdnLogisticsReq struct {
|
||||
LogisticCode string `json:"LogisticCode"` // 物流单号
|
||||
ShipperCode string `json:"ShipperCode"` // 快递公司编码
|
||||
CustomerName string `json:"CustomerName"` // 寄件人或收件人的手机号后四位数字
|
||||
}
|
||||
|
@@ -36,9 +36,9 @@ func New(eBusinessID, appKey string) *kdniao {
|
||||
logisticCode:物流单号
|
||||
shipperCode:快递公司编码
|
||||
*/
|
||||
func (k *kdniao) GetLogisticsTrack(logisticCode, shipperCode string) *KdnLogistics {
|
||||
func (k *kdniao) GetLogisticsTrack(logisticCode, shipperCode, customerName string) *KdnLogistics {
|
||||
resp := &KdnLogistics{}
|
||||
k.post(EbusinessOrderHandleUrl, "8001", &kdnLogisticsReq{LogisticCode: logisticCode, ShipperCode: shipperCode}, resp)
|
||||
k.post(EbusinessOrderHandleUrl, "8001", &kdnLogisticsReq{LogisticCode: logisticCode, ShipperCode: shipperCode, CustomerName: customerName}, resp)
|
||||
if !resp.Success {
|
||||
mylog.Errorf("Call Fetch Logistics Failed. Reason: %v", resp.Reason)
|
||||
return resp
|
||||
@@ -57,6 +57,7 @@ func (k *kdniao) post(_url, requestType string, request, resp interface{}) {
|
||||
|
||||
body := myhttp.OnPostForm(_url, vs)
|
||||
|
||||
mylog.Info(string(body))
|
||||
if err := json.Unmarshal(body, resp); err != nil {
|
||||
mylog.Error(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user