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
50
51
52
53
54
55
56
57
58
59
60
package ikc
import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
type deliverIkc struct {
}
var Deliver = deliverIkc{}
type DeliverDetailRes struct {
ResultCode int `json:"resultCode"`
ResultMessage string `json:"resultMessage"`
Data struct {
OrderId string `json:"orderId"`
ShipmentList []struct {
OrderDetailId string `json:"orderDetailId"`
ShipmentNo string `json:"shipmentNo"`
LogisticsCompany string `json:"logisticsCompany"`
LogisticsCompanyName string `json:"logisticsCompanyName"`
LogisticsCode string `json:"logisticsCode"`
} `json:"shipmentList"`
} `json:"data"`
}
func (*deliverIkc) Detail(ctx context.Context, orderId string) (res *DeliverDetailRes, err error) {
method := "order/queryLogistics"
result, err := post(ctx, method, g.Map{
"orderId": orderId,
})
_ = gjson.New(result).Scan(&res)
return
}
type DeliverTrackRes struct {
ResultCode int `json:"resultCode"`
ResultMessage string `json:"resultMessage"`
Data []struct {
LogisticsNo string `json:"logisticsNo"`
LogisticsCompany string `json:"logisticsCompany"`
ExpressCompanyNo int `json:"expressCompanyNo,omitempty"`
TraceItemList []struct {
Time string `json:"time"`
Content string `json:"content"`
} `json:"traceItemList"`
} `json:"data"`
}
//Track 物流轨迹
func (*deliverIkc) Track(ctx context.Context, orderId string) (res *DeliverTrackRes, err error) {
method := "delivery/order/track"
result, err := post(ctx, method, g.Map{
"orderId": orderId,
})
_ = gjson.New(result).Scan(&res)
return
}