-
Notifications
You must be signed in to change notification settings - Fork 1
/
taobao.go
76 lines (63 loc) · 1.98 KB
/
taobao.go
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package dataoke
import "encoding/json"
// 淘宝API
// 商品列表
func (c *Client) GetGoodsList(params map[string]string) (string, error) {
return c.Get("/goods/get-goods-list", params)
}
// 单品详情
func (c *Client) GetGoodsDetails(params map[string]string) (string, error) {
return c.Get("/goods/get-goods-details", params)
}
// 超级分类
func (c *Client) GetSuperCategory(params map[string]string) (*GetSuperCategoryResp, error) {
resp, err := c.Get("/category/get-super-category", params)
if err != nil {
return nil, err
}
var data GetSuperCategoryResp
if err := json.Unmarshal([]byte(resp), &data); err != nil {
return nil, err
}
return &data, nil
}
// 轮播图
func (c *Client) CarouseList(params map[string]string) (*CarouseListResp, error) {
resp, err := c.Get("/goods/topic/carouse-list", params)
if err != nil {
return nil, err
}
var data CarouseListResp
if err := json.Unmarshal([]byte(resp), &data); err != nil {
return nil, err
}
return &data, nil
}
// 高效转链
func (c *Client) GetPrivilegeLink(params map[string]string) (string, error) {
return c.Get("/tb-service/get-privilege-link", params)
}
// 超级搜索
func (c *Client) ListSuperGoods(params map[string]string) (string, error) {
return c.Get("/goods/list-super-goods", params)
}
// 大淘客搜索
func (c *Client) GetDtkSearchGoods(params map[string]string) (string, error) {
return c.Get("/goods/get-dtk-search-goods", params)
}
// 联盟搜索
func (c *Client) GetTbService(params map[string]string) (string, error) {
return c.Get("/tb-service/get-tb-service", params)
}
// 联想词
func (c *Client) SearchSuggestion(params map[string]string) (string, error) {
return c.Get("/goods/search-suggestion", params)
}
// 热搜记录
func (c *Client) GetTop100(params map[string]string) (string, error) {
return c.Get("/category/get-top100", params)
}
// 热搜记录
func (c *Client) GetRankingList(params map[string]string) (string, error) {
return c.Get("/goods/get-goods-details", params)
}