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
package dwd
import (
"context"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
//物流
type deliveryDwd struct {
}
var Delivery = &deliveryDwd{}
type DeliveryListRes struct {
Errno int `json:"errno"`
Errmsg string `json:"errmsg"`
Data *DeliveryListData `json:"data"`
RequestId string `json:"request_id"`
Timestamp int `json:"timestamp"`
Signature string `json:"signature"`
}
type DeliveryListData struct {
List []struct {
Name string `json:"name"`
Code string `json:"code"`
} `json:"list"`
}
func (*deliveryDwd) List(ctx context.Context) (res *DeliveryListRes, err error) {
var method = "common.deliveryList"
result, err := post(ctx, method, g.Map{})
if err != nil {
return
}
res = &DeliveryListRes{
Errno: result.Errno,
Errmsg: result.Errmsg,
RequestId: result.RequestId,
Timestamp: result.Timestamp,
Signature: result.Signature,
}
_ = gjson.New(result.Data).Scan(&res.Data)
return
}