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 tm
import (
"context"
"github.com/gogf/gf/encoding/gjson"
)
type logisticsTm struct {
}
var Logistics = logisticsTm{}
type LogisticsTraceRes struct {
Code string `json:"Code"`
Message string `json:"Message"`
RequestId string `json:"RequestId"`
Data struct {
Data []struct {
DataProvider string `json:"DataProvider"`
LogisticsCompanyName string `json:"LogisticsCompanyName"` //物流公司名称
MailNo string `json:"MailNo"` //运单号
LogisticsCompanyCode string `json:"LogisticsCompanyCode"` //物流公司Code
LogisticsDetailList struct {
LogisticsDetailList []struct {
StanderdDesc string `json:"StanderdDesc"`
OcurrTimeStr string `json:"OcurrTimeStr"`
} `json:"LogisticsDetailList"`
} `json:"LogisticsDetailList"`
DataProviderTitle string `json:"DataProviderTitle"`
} `json:"Data"`
} `json:"Data"`
}
//Trace 物流查询接口
func (s *logisticsTm) Trace(ctx context.Context, UserId, LmOrderId string) (res *LogisticsTraceRes, err error) {
method := "queryLogistics"
request := map[string]string{
"BizUid": server.BizUid,
"LmOrderId": LmOrderId,
"AccountType": "ANONY",
"ThirdPartyUserId": UserId,
}
result, err := post(ctx, method, request)
err = gjson.New(result).Scan(&res)
return
}