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
package hdh
import (
"context"
"encoding/json"
"github.com/gogf/gf/frame/g"
)
//分类列表
type CategoryListRes struct {
Code string `json:"code"`
Data []struct {
ID int `json:"id"` //类目id
LogoURL string `json:"logoUrl"` //类目logo图片地址
Name string `json:"name"` //类目名称
SubCategoryList []struct {
ID int `json:"id"` //类目id
LogoURL string `json:"logoUrl"` //类目logo图片地址
Name string `json:"name"` //类目名称
SubCategoryList []struct {
ID int `json:"id"` //
LogoURL string `json:"logoUrl"` //
Name string `json:"name"` //
} `json:"subCategoryList"` //
} `json:"subCategoryList"` //
} `json:"data"`
Message string `json:"message"`
Success int `json:"success"`
}
//获取分类列表
func GetCategoryList(ctx context.Context) (res *CategoryListRes, err error) {
params := g.Map{}
result, err := post(ctx, "/cate/get_category_list.do", params)
if nil != err {
return
}
err = json.Unmarshal([]byte(result), &res)
return
}