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
package dwd
import (
"context"
"github.com/gogf/gf/encoding/gjson"
)
//类目
type categoryDwd struct {
}
var Category = &categoryDwd{}
type CategoryListReq struct {
Pid string `json:"pid"`
Depth string `json:"depth"`
}
type CategoryListRes struct {
Errno int `json:"errno"`
Errmsg string `json:"errmsg"`
Data *CategoryListData `json:"data"`
RequestId string `json:"request_id"`
Timestamp int `json:"timestamp"`
Signature string `json:"signature"`
}
type CategoryListData struct {
List []struct {
Id int `json:"id"`
Pid int `json:"pid"`
Depth int `json:"depth"`
CategoryName string `json:"categoryName"`
} `json:"list"`
}
func (*categoryDwd) List(ctx context.Context, req CategoryListReq) (res *CategoryListRes, err error) {
var method = "common.categoryBackList"
result, err := post(ctx, method, req)
if err != nil {
return
}
res = &CategoryListRes{
Errno: result.Errno,
Errmsg: result.Errmsg,
RequestId: result.RequestId,
Timestamp: result.Timestamp,
Signature: result.Signature,
}
_ = gjson.New(result.Data).Scan(&res.Data)
return
}