提交 722c1338 authored 作者: 张立波's avatar 张立波

dwd LogisticsTrace

上级 c09465a9
package dwd
import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/util/gconv"
)
type logisticsDwd struct {
}
var Logistics = logisticsDwd{}
type LogisticsTraceReq struct {
BatchNo string `json:"batch_no,omitempty"`
OutOrderId string `json:"out_order_id,omitempty"`
OrderId int `json:"order_id"`
}
type LogisticsTraceRes struct {
LogisticsDetail struct {
Contacter string `json:"contacter"`
Mobile string `json:"mobile"`
DeliveryComCode string `json:"delivery_com_code"`
DeliveryComName string `json:"delivery_com_name"`
Note string `json:"note"`
UpdatedAtFormat string `json:"updated_at_format"`
} `json:"logisticsDetail"`
TranceDetail struct {
DeliveryNo string `json:"delivery_no"`
DeliveryComCode string `json:"delivery_com_code"`
DeliveryComName string `json:"delivery_com_name"`
Status int `json:"status"`
StatusText string `json:"status_text"`
Msg []struct {
Time string `json:"time"`
Context string `json:"context"`
Ftime string `json:"ftime,omitempty"`
AreaName string `json:"areaName,omitempty"`
Status string `json:"status,omitempty"`
Location string `json:"location,omitempty"`
} `json:"msg"`
ResetRecord []struct {
OldDeliveryNo string `json:"old_delivery_no"`
OldDeliveryComCode string `json:"old_delivery_com_code"`
OldDeliveryComName string `json:"old_delivery_com_name"`
DeliveryNo string `json:"delivery_no"`
DeliveryComCode string `json:"delivery_com_code"`
DeliveryComName string `json:"delivery_com_name"`
CreatedAt int `json:"created_at"`
} `json:"resetRecord"`
} `json:"tranceDetail"`
ReTranceDetail struct {
} `json:"reTranceDetail"`
DeliveryWay int `json:"delivery_way"`
SubDeliveryNoList []struct {
DeliveryComCode string `json:"delivery_com_code"`
DeliveryComName string `json:"delivery_com_name"`
DeliveryNo string `json:"delivery_no"`
} `json:"sub_delivery_no_list"`
SubDeliveryNo string `json:"sub_delivery_no"`
}
// Trace 物流轨迹
func (*logisticsDwd) Trace(ctx context.Context, req LogisticsTraceReq) (res *LogisticsTraceRes, err error) {
method := "order.expressTrace"
result, err := post(ctx, method, gconv.Map(req))
if err != nil {
return
}
_ = gjson.New(result.Data).Scan(&res)
return
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论