From d2054e9f90b20e6fc34f19e369b850326326e4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Tue, 10 Jan 2023 17:49:07 +0800 Subject: [PATCH] - update pinduoduo --- library.go | 2 +- service/pinduoduo/cat_id.go | 86 +++++++++++++++++++++++++++++++ service/pinduoduo/channel_type.go | 34 ++++++++++++ service/pinduoduo/opt_id.go | 86 +++++++++++++++++++++++++++++++ service/pinduoduo/sort_type.go | 22 ++++++++ 5 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 service/pinduoduo/cat_id.go create mode 100644 service/pinduoduo/channel_type.go create mode 100644 service/pinduoduo/opt_id.go create mode 100644 service/pinduoduo/sort_type.go diff --git a/library.go b/library.go index 364a654b..69ba37ab 100644 --- a/library.go +++ b/library.go @@ -1,5 +1,5 @@ package go_library func Version() string { - return "1.0.72" + return "1.0.73" } diff --git a/service/pinduoduo/cat_id.go b/service/pinduoduo/cat_id.go new file mode 100644 index 00000000..7500ab6d --- /dev/null +++ b/service/pinduoduo/cat_id.go @@ -0,0 +1,86 @@ +package pinduoduo + +type GetCatIdListResponse struct { + CatId int64 `json:"cat_id"` + CatName string `json:"cat_name"` +} + +func (c *Client) GetCatIdList() []GetCatIdListResponse { + + var lists []GetCatIdListResponse + + lists = append(lists, GetCatIdListResponse{ + CatId: 20100, + CatName: "百货", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20200, + CatName: "母婴", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20300, + CatName: "食品", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20400, + CatName: "女装", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20500, + CatName: "电器", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20600, + CatName: "鞋包", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20700, + CatName: "内衣", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20800, + CatName: "美妆", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 20900, + CatName: "男装", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21000, + CatName: "水果", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21100, + CatName: "家纺", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21200, + CatName: "文具", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21300, + CatName: "运动", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21400, + CatName: "虚拟", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21500, + CatName: "汽车", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21600, + CatName: "家装", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21700, + CatName: "家具", + }) + lists = append(lists, GetCatIdListResponse{ + CatId: 21800, + CatName: "医药", + }) + + return lists +} diff --git a/service/pinduoduo/channel_type.go b/service/pinduoduo/channel_type.go new file mode 100644 index 00000000..e4fe58a6 --- /dev/null +++ b/service/pinduoduo/channel_type.go @@ -0,0 +1,34 @@ +package pinduoduo + +type GetChannelTypeListResponse struct { + ChannelType int64 `json:"channel_type"` + ChannelName string `json:"channel_name"` +} + +func (c *Client) GetChannelTypeList() []GetChannelTypeListResponse { + + var lists []GetChannelTypeListResponse + + lists = append(lists, GetChannelTypeListResponse{ + ChannelType: 1, + ChannelName: "今日热销榜", + }) + lists = append(lists, GetChannelTypeListResponse{ + ChannelType: 3, + ChannelName: "相似商品推荐", + }) + lists = append(lists, GetChannelTypeListResponse{ + ChannelType: 4, + ChannelName: "猜你喜欢", + }) + lists = append(lists, GetChannelTypeListResponse{ + ChannelType: 5, + ChannelName: "实时热销榜", + }) + lists = append(lists, GetChannelTypeListResponse{ + ChannelType: 6, + ChannelName: "实时收益榜", + }) + + return lists +} diff --git a/service/pinduoduo/opt_id.go b/service/pinduoduo/opt_id.go new file mode 100644 index 00000000..5449db0d --- /dev/null +++ b/service/pinduoduo/opt_id.go @@ -0,0 +1,86 @@ +package pinduoduo + +type GetOptIdListResponse struct { + OptId int64 `json:"opt_id"` + OptName string `json:"opt_name"` +} + +func (c *Client) GetOptIdList() []GetOptIdListResponse { + + var lists []GetOptIdListResponse + + lists = append(lists, GetOptIdListResponse{ + OptId: 1, + OptName: "食品", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 4, + OptName: "母婴", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 13, + OptName: "水果", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 14, + OptName: "女装", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 15, + OptName: "百货", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 16, + OptName: "美妆", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 18, + OptName: "电器", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 590, + OptName: "虚拟", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 743, + OptName: "男装", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 818, + OptName: "家纺", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 1281, + OptName: "鞋包", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 1282, + OptName: "内衣", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 1451, + OptName: "运动", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 1917, + OptName: "家装", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 2048, + OptName: "汽车", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 2478, + OptName: "文具", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 2974, + OptName: "家具", + }) + lists = append(lists, GetOptIdListResponse{ + OptId: 3279, + OptName: "医药", + }) + + return lists +} diff --git a/service/pinduoduo/sort_type.go b/service/pinduoduo/sort_type.go new file mode 100644 index 00000000..367bf671 --- /dev/null +++ b/service/pinduoduo/sort_type.go @@ -0,0 +1,22 @@ +package pinduoduo + +type GetSortTypeListResponse struct { + SortType int64 `json:"sort_type"` + SortName string `json:"sort_name"` +} + +func (c *Client) GetSortTypeList() []GetSortTypeListResponse { + + var lists []GetSortTypeListResponse + + lists = append(lists, GetSortTypeListResponse{ + SortType: 1, + SortName: "实时热销榜", + }) + lists = append(lists, GetSortTypeListResponse{ + SortType: 2, + SortName: "实时收益榜", + }) + + return lists +}