提交 8b312df1 authored 作者: 张立波's avatar 张立波

dwd LogisticsTrace

上级 722c1338
...@@ -17,6 +17,15 @@ type LogisticsTraceReq struct { ...@@ -17,6 +17,15 @@ type LogisticsTraceReq struct {
OrderId int `json:"order_id"` OrderId int `json:"order_id"`
} }
type LogisticsTraceRes struct { type LogisticsTraceRes struct {
Errno int `json:"errno"`
Errmsg string `json:"errmsg"`
Data *LogisticsTraceData `json:"data"`
RequestId string `json:"request_id"`
Timestamp int `json:"timestamp"`
Signature string `json:"signature"`
}
type LogisticsTraceData struct {
LogisticsDetail struct { LogisticsDetail struct {
Contacter string `json:"contacter"` Contacter string `json:"contacter"`
Mobile string `json:"mobile"` Mobile string `json:"mobile"`
...@@ -67,6 +76,13 @@ func (*logisticsDwd) Trace(ctx context.Context, req LogisticsTraceReq) (res *Log ...@@ -67,6 +76,13 @@ func (*logisticsDwd) Trace(ctx context.Context, req LogisticsTraceReq) (res *Log
if err != nil { if err != nil {
return return
} }
_ = gjson.New(result.Data).Scan(&res) res = &LogisticsTraceRes{
Errno: result.Errno,
Errmsg: result.Errmsg,
RequestId: result.RequestId,
Timestamp: result.Timestamp,
Signature: result.Signature,
}
_ = gjson.New(result.Data).Scan(&res.Data)
return return
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论