1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package tmv3
import (
"context"
"github.com/alibabacloud-go/tea/tea"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/os/gtime"
)
type LogisticsTraceReq struct {
OrderId string
}
type LogisticsTraceRes struct {
RequestId string `json:"requestId"`
LogisticsOrderList []struct {
DataProvider string `json:"dataProvider"`
DataProviderTitle string `json:"dataProviderTitle"`
Goods []struct {
GoodName string `json:"goodName"`
ProductId interface{} `json:"productId"`
Quantity int `json:"quantity"`
} `json:"goods"`
LogisticsCompanyCode string `json:"logisticsCompanyCode"`
LogisticsCompanyName string `json:"logisticsCompanyName"`
LogisticsDetailList []struct {
OcurrTimeStr string `json:"ocurrTimeStr"`
StanderdDesc string `json:"standerdDesc"`
} `json:"logisticsDetailList"`
MailNo string `json:"mailNo"`
} `json:"logisticsOrderList"`
}
// Trace 查询订单物流信息
func (s logisticsTm) Trace(ctx context.Context, req LogisticsTraceReq) (res *LogisticsTraceRes, err error) {
Start := gtime.TimestampMilli()
ctx = context.WithValue(ctx, "URI", "ListLogisticsOrders")
defer func() {
Log(ctx, req, res, err, Start)
}()
r, err := server.ListLogisticsOrders(tea.String(req.OrderId))
if err != nil {
return
}
err = gjson.New(r.Body).Scan(&res)
return
}