diff --git a/README.md b/README.md index 80c0faf694cfcf021cb765b8cb68578086b49734..e1cb16fa3413c86e9eb77d1e816dcedeb9d04ced 100644 --- a/README.md +++ b/README.md @@ -3,35 +3,96 @@ #### 介绍 大淘客开放平台SDK PYTHON版 -#### 软件架构 -软件架构说明 - - #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +1. 依赖包安装 + pip install requests +2. 安装 + + 1)下载安装包 + + git clone https://gitee.com/dtk-developer/openapi-sdk-python.git + 或者下载压缩包 + + 2)安装 + python setup.py install + #### 使用说明 +**** +`热搜记录` + +from dtkApi.search import Top100Req + +appKey = 'xxx' + +appSecret = 'xxx' + +version = 'v1.0.1' # 当前版本号 + +gr=Top100Req(appKey,appSecret,version) + +gr.setParams("type",1) + +gr.setParams("keyWords","男装") + +data=gr.getResponse() + +print(data) + +**** +`商品列表` + +from dtkApi.save import GoodsListReq + +appKey = 'xxx' + +appSecret = 'xxx' + +version = 'v1.2.4' # 当前版本号 + +gr=GoodsListReq(appKey,appSecret,version) + +gr.setParams("pageId",1) + +data=gr.getResponse() + +print(data) + +**** +`各大榜单` + +from dtkApi.original import RankingListReq + +appKey = 'xxx' + +appSecret = 'xxx' + +version = 'v1.3.0' # 当前版本号 + +gr=RankingListReq(appKey,appSecret,version) + +gr.setParams("rankType",1) + +data=gr.getResponse() + +print(data) + +**** +`高效转链` + +from dtkApi.basic import PrivilegeLinkReq + +appKey = 'xxx' -1. xxxx -2. xxxx -3. xxxx +appSecret = 'xxx' -#### 参与贡献 +version = 'v1.3.1' # 当前版本号 -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +gr=PrivilegeLinkReq(appKey,appSecret,version) +gr.setParams("goodsId","2222112") -#### 特技 +data=gr.getResponse() -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +print(data) diff --git a/dtkApi/__init__.py b/dtkApi/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7cca03f396c369d8b6a73d7307524640afd2ab4c --- /dev/null +++ b/dtkApi/__init__.py @@ -0,0 +1 @@ +from dtkApi import * \ No newline at end of file diff --git a/dtkApi/__pycache__/__init__.cpython-36.pyc b/dtkApi/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..027ffcc4bfc6fc0a52f08ccebeb6f926f3f668a5 Binary files /dev/null and b/dtkApi/__pycache__/__init__.cpython-36.pyc differ diff --git a/dtkApi/apiRequest/Request.py b/dtkApi/apiRequest/Request.py new file mode 100644 index 0000000000000000000000000000000000000000..ab23def2473773154c31891f7e19453bb0d30497 --- /dev/null +++ b/dtkApi/apiRequest/Request.py @@ -0,0 +1,94 @@ +# -*- coding:utf8 -*- +import operator +import hashlib +import copy +import subprocess +import logging +logging.captureWarnings(True) +try: + import requests +except: + print('尚未安装requests库,正在安装,请稍后!') + subprocess.call('pip install requests') + print('requests库安装成功!第一次调用接口!') + import requests +class Request(): + #将公共参数 初始化 + def __init__(self,appKey,appSecret,apiVersion): + self.appKey=appKey + self.appSecret=appSecret + self.apiVersion=apiVersion + self.params={} + + def md5(self,arg): + md5 = hashlib.md5() + loc_bytes_utf8 = arg.encode(encoding="utf-8") + md5.update(loc_bytes_utf8) + return md5.hexdigest() + """#key 加密算法 + 1:对传入的产生 按照key 进行排序 + 2:将排序后的数据 将各数据字段 用字符串 ‘&’连接起来 + 如:data={appkey:123,pageId:1} 处理后 appkey=123&pageId=1 + 3:在处理后的数据字符串后追加 appSecret 如 appSecret=helloworld 则 最终 加密字符串为appkey=123&pageId=1&key=hellworld + 4:采用MD5加密算法对 处理后的字符串进行加密 + """ + + def md5_sign(self,args=None): + copy_args =copy.deepcopy(args) + #对传入的参数 按照key 排序 + sorted_args = sorted(copy_args.items(), key=operator.itemgetter(0)) + tmp = [] + for i in sorted_args: + tmp.append('{}={}'.format(list(i)[0], list(i)[1])) + sign = self.md5('&'.join(tmp) + '&' + 'key={}'.format(self.appSecret)).upper() + copy_args['sign'] = sign + return copy_args + def check_args(self,arg,check_params): + params=copy.deepcopy(check_params) + if arg: + if len(check_params)>0: + for key in check_params: + if key in arg.keys(): + params.remove(key) + # print(self.__class__.check_parmas,list(arg.keys())) + # print(i) + if len(params)==0: + return True + else: + print("请传入必要参数%s"%str(params)) + return False + else: + return True + else: + if len(check_params)>0: + print("请传入必要参数%s"%str(check_params)) + return False + else: + return True + #设置传入参数 + def setParams(self,key,value): + self.params[key]=value + def request(self,method,api_url,args,UserAgent=None,ContentType=None): + url="https://openapi.dataoke.com/api/"+api_url + if UserAgent == None: + headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36", + 'Content-Type':ContentType} + else: + headers = {"User-Agent": UserAgent,'Content-Type': ContentType} + # 将appkey 加入 待排序 + args['appKey']=self.appKey + #将apiVersion 加入 + args['version']=self.apiVersion + #生成签名 + data = self.md5_sign(args=args) + # print(data) + method_tmp = method.lower() + if method_tmp == 'get': + response = requests.request(method=method_tmp,url=url,params=data,headers=headers,verify=False).json() + return response + elif method_tmp == 'post': + response = requests.request(method=method_tmp,url=url,data=data,headers=headers,verify=False).json() + return response + + + diff --git a/dtkApi/apiRequest/__init__.py b/dtkApi/apiRequest/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6653fce7079885ecd2e93071fce7fca4ef2e4d62 --- /dev/null +++ b/dtkApi/apiRequest/__init__.py @@ -0,0 +1 @@ +from dtkApi.apiRequest.Request import Request diff --git a/dtkApi/apiRequest/__pycache__/Request.cpython-36.pyc b/dtkApi/apiRequest/__pycache__/Request.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..553e3e355d5174158179649fcaf91916f8e83138 Binary files /dev/null and b/dtkApi/apiRequest/__pycache__/Request.cpython-36.pyc differ diff --git a/dtkApi/apiRequest/__pycache__/__init__.cpython-36.pyc b/dtkApi/apiRequest/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2edc9a99c6febc55dcbc645db28eba88041e067c Binary files /dev/null and b/dtkApi/apiRequest/__pycache__/__init__.cpython-36.pyc differ diff --git a/dtkApi/basic/ActivityLinkReq.py b/dtkApi/basic/ActivityLinkReq.py new file mode 100644 index 0000000000000000000000000000000000000000..6585dfcdaa82e334bed18badb21bb94504c3d7c1 --- /dev/null +++ b/dtkApi/basic/ActivityLinkReq.py @@ -0,0 +1,18 @@ +# -*- coding:utf8-*- + +"""官方活动会场转链 +@promotionSceneId:string 必须 联盟官方活动ID,从联盟官方活动页获取(或从大淘客官方活动推广接口获取(饿了么微信推广活动ID:20150318020002192,饿了么外卖活动ID:20150318019998877,饿了么商超活动ID:1585018034441) +@pid string 非必须 推广pid,默认为在”我的应用“添加的pid +@relationId string 非必须 渠道id将会和传入的pid进行验证,验证通过将正常转链,请确认填入的渠道id是正确的 +@unionId string 非必须 自定义输入串,英文和数字组成,长度不能大于12个字符,区分不同的推广渠道 +""" +from dtkApi.apiRequest import Request + + +class ActivityLinkReq(Request): + url='/tb-service/activity-link' + check_params=['promotionSceneId'] + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) \ No newline at end of file diff --git a/dtkApi/basic/CollectionListReq.py b/dtkApi/basic/CollectionListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..1e0870a988dc215102020c203d54e3f4ce69e37c --- /dev/null +++ b/dtkApi/basic/CollectionListReq.py @@ -0,0 +1,24 @@ +# -*- coding:utf8-*- + +"""我的收藏 +@pageId string 必须 默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid +,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +@pageSize Number 非必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +@cid string 必须 商品在大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。当一级类目id和二级类目id同时传入时,会自动忽略二级类目id,1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品, +6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺 +@trailerType number 非必须 是否返回预告商品,1为预告商品,0为在线商品,不填则全部商品 +@sort string 非必须 排序字段,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +@collectionTimeOrder number 非必须 加入收藏时间 + """ + +from dtkApi.apiRequest import Request + + +class CollectionListReq(Request): + url = 'goods/get-collection-list' + check_params = ['pageId', 'cid'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/CreatTaokoulingReq.py b/dtkApi/basic/CreatTaokoulingReq.py new file mode 100644 index 0000000000000000000000000000000000000000..1e3ce8134e525fa4dbbb45fc29ba066632e2bfce --- /dev/null +++ b/dtkApi/basic/CreatTaokoulingReq.py @@ -0,0 +1,19 @@ + +# -*- coding:utf8-*- +""" +淘口令生成 +text string 必须 口令弹框内容,长度大于5个字符 +url string 必须 口令跳转目标页,如:https://uland.taobao.com/,必须以https开头,可以是二合一链接、长链接、短链接等各种淘宝高佣链接;支持渠道备案链接。* 该参数需要进行Urlencode编码后传入* +logo string 非必须 口令弹框logoURL +userId string 非必须 生成口令的淘宝用户ID,非必传参数 +""" +from dtkApi.apiRequest import Request + +class CreatTaokoulingReq(Request): + url='tb-service/creat-taokouling' + check_params=['text','url'] + #GET请求 + def getResponse(self): + if self.check_args(self.params,self.check_params): + return self.request('GET',api_url=self.url,args=self.params) + \ No newline at end of file diff --git a/dtkApi/basic/FirstOrderGiftMoneyReq.py b/dtkApi/basic/FirstOrderGiftMoneyReq.py new file mode 100644 index 0000000000000000000000000000000000000000..28f1d73932686df210f8cefddc2d32125c5a82c5 --- /dev/null +++ b/dtkApi/basic/FirstOrderGiftMoneyReq.py @@ -0,0 +1,23 @@ +# -*- coding:utf8-*- + +""" +首单礼金商品 +@pageSize Number 必须 每页返回条数,每页条数支持输入10,20,50,100,200 +@pageId String 必须 分页id:常规分页方式,请直接传入对应页码(比如:1,2,3……) +@cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品,6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺 +@sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +@keyWord String 非必须 输入关键词搜索(新增字段) +@goodsType Number 非必须 商品类型1表示大淘客商品2表示联盟商品。默认为1 (2020.11.4新增字段) +""" + +from dtkApi.apiRequest import Request + + +class FirstOrderGiftMoneyReq(Request): + url = 'goods/first-order-gift-money' + check_params = ['pageId', 'pageSize'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/JdGoodsLinkReq.py b/dtkApi/basic/JdGoodsLinkReq.py new file mode 100644 index 0000000000000000000000000000000000000000..c8285ddfce8fb76081b82a32c92461857fa0d389 --- /dev/null +++ b/dtkApi/basic/JdGoodsLinkReq.py @@ -0,0 +1,24 @@ +# -*- coding:utf8-*- +from dtkApi.apiRequest import Request + +""" +京东商品转链 + @unionId Long 必须 推客的联盟ID + @materialId String 必须 推广物料url,例如活动链接、商品链接等;不支持仅传入skuid + @positionId Long 非必须 新增推广位id (若无subUnionId权限,可入参该参数用来确定不同用户下单情况) + @childPid String 非必须 联盟子推客身份标识(不能传入接口调用者自己的pid) + @subUnionId String 非必须 子渠道标识,您可自定义传入字母、数字或下划线,最多支持80个字符,该参数会在订单行查询接口中展示,需要有权限才可使用 + @couponUrl String 非必须 优惠券领取链接,在使用优惠券、商品二合一功能时入参,且materialId须为商品详情页链接(5.27更新:若不填则会自动匹配上全额最大的优惠券进行转链) + @chainType Integer 非必须 转链类型,默认短链,短链有效期60天1:长链2:短链 3:长链+短链, + @giftCouponKey String 非必须 礼金批次号 +""" + + +class JdGoodsLinkReq(Request): + url = 'dels/jd/kit/promotion-union-convert' + check_params = ['unionId','materialId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/OrderDetailsReq.py b/dtkApi/basic/OrderDetailsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..a1cfad424f39bed50c619b1aa92cdb73d40fcf54 --- /dev/null +++ b/dtkApi/basic/OrderDetailsReq.py @@ -0,0 +1,28 @@ +# -*- coding:utf8-*- + +""" +淘系订单查询 + @queryType Number 必须 查询时间类型,1:按照订单淘客创建时间查询,2:按照订单淘客付款时间查询,3:按照订单淘客结算时间查询,4:按照订单更新时间(5.27新增字段) + @positionIndex String 非必须 位点,第一页数据返回里面有个这个字段,查第二页的数据的时候就传过去 + @pageSize Number 非必须 页大小,默认20,1~100 + @memberType Number 非必须 推广者角色类型,2:二方,3:三方,不传,表示所有角色 + @tkStatus Number 非必须 淘客订单状态,12-付款,13-关闭,14-确认收货,3-结算成功;不传,表示所有状态 + @endTime String 必须 订单查询结束时间,订单开始时间至订单结束时间,中间时间段日常要求不超过3个小时,但如618、双11、年货节等大促期间预估时间段不可超过20分钟,超过会提示错误,调用时请务必注意时间段的选择,以保证亲能正常调用! 时间格式:YYYY-MM-DD HH:MM:SS + @startTime String 必须 订单查询开始时间。时间格式:YYYY-MM-DD HH:MM:SS + @jumpType Number 非必须 跳转类型,当向前或者向后翻页必须提供,-1: 向前翻页,1:向后翻页 + @pageNo Number 非必须 第几页,默认1,1~100 + @orderScene Number 非必须 场景订单场景类型,1:常规订单,2:渠道订单,3:会员运营订单,默认为1 + +""" + +from dtkApi.apiRequest import Request + + +class OrderDetailsReq(Request): + url = 'tb-service/get-order-details' + check_params = ['queryType','endTime','startTime'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/ParseContentReq.py b/dtkApi/basic/ParseContentReq.py new file mode 100644 index 0000000000000000000000000000000000000000..65ddbfc749e0485112d3eaf4d3c206edc4f05292 --- /dev/null +++ b/dtkApi/basic/ParseContentReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- + +""" +淘系万能解析 +@content String 必须 包含淘口令、链接的文本。优先解析淘口令,再按序解析每个链接,直至解出有效信息。如果淘口令失效或者不支持的类型的情况,会按顺序解析链接。如果存在解析失败,请再试一次 +""" +from dtkApi.apiRequest import Request + + +class ParseContentReq(Request): + url = 'tb-service/parse-content' + check_params = ['content'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/ParseTaokoulingReq.py b/dtkApi/basic/ParseTaokoulingReq.py new file mode 100644 index 0000000000000000000000000000000000000000..49b74092cdae6a837e2c806434803911ffb20678 --- /dev/null +++ b/dtkApi/basic/ParseTaokoulingReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- + +""" +淘口令解析 +@content String 必须 包含淘口令的文本。 若文本中有多个淘口令,仅解析第一个。(目前仅支持商品口令和二合一券口令) +""" +from dtkApi.apiRequest import Request + + +class ParseTaokoulingReq(Request): + url = 'tb-service/parse-taokouling' + check_params = ['content'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/PrivilegeLinkReq.py b/dtkApi/basic/PrivilegeLinkReq.py new file mode 100644 index 0000000000000000000000000000000000000000..7d1e65724160c22bd808429559e75d6427ae7e69 --- /dev/null +++ b/dtkApi/basic/PrivilegeLinkReq.py @@ -0,0 +1,27 @@ +# -*- coding:utf8-*- + +""" +高效转链 + @goodsId String 必须 淘宝商品id + @couponId String 非必须 商品的优惠券ID,一个商品在联盟可能有多个优惠券,可通过填写该参数的方式选择使用的优惠券,请确认优惠券ID正确,否则无法正常跳转 + @pid string 非必须 推广位ID,用户可自由填写当前大淘客账号下已授权淘宝账号的任一pid,若未填写,则默认使用创建应用时绑定的pid + @channelId string 非必须 渠道id将会和传入的pid进行验证,验证通过将正常转链,请确认填入的渠道id是正确的 channelId对应联盟的relationId + @rebateType Number 非必须 付定返红包,0.不使用付定返红包,1.参与付定返红包 + @specialId string 非必须 会员运营id + @externalId string 非必须 淘宝客外部用户标记,如自身系统账户ID;微信ID等 + @xid string 非必须 团长与下游渠道合作的特殊标识,用于统计渠道推广效果 (新增入参) + @leftSymbol string 非必须 淘口令左边自定义符号,默认¥ (2021/3/9新增入参) + @rightSymbol string 非必须 淘口令右边自定义符号,默认¥ (2021/3/9新增入参) + +""" +from dtkApi.apiRequest import Request + + +class PrivilegeLinkReq(Request): + url = 'tb-service/get-privilege-link' + check_params = ['goodsId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/SuperCategoryReq.py b/dtkApi/basic/SuperCategoryReq.py new file mode 100644 index 0000000000000000000000000000000000000000..f4b6baa0986e1c0a4e9768c526208794b2baf107 --- /dev/null +++ b/dtkApi/basic/SuperCategoryReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- + +""" +超级分类 + +""" +from dtkApi.apiRequest import Request + + +class SuperCategoryReq(Request): + url = 'category/get-super-category' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/TwdToTwdReq.py b/dtkApi/basic/TwdToTwdReq.py new file mode 100644 index 0000000000000000000000000000000000000000..48f3d7bffe6fe9823be9d2d5f7e89ed1530fd78e --- /dev/null +++ b/dtkApi/basic/TwdToTwdReq.py @@ -0,0 +1,21 @@ +# -*- coding:utf8-*- + +""" +淘口令转淘口令 +  @content string 必须 支持包含文本的淘口令,但最好是一个单独淘口令 +  @pid string 非必须 推广位ID,用户可自由填写当前大淘客账号下已授权淘宝账号的任一pid,若未填写,则默认使用创建应用时绑定的pid +  @channelId string 非必须 渠道id将会和传入的pid进行验证,验证通过将正常转链,请确认填入的渠道id是正确的 +  @special_id string 非必须 会员运营ID +  @external_id string 非必须 淘宝客外部用户标记,如自身系统账户ID;微信ID等 +""" +from dtkApi.apiRequest import Request + + +class TwdToTwdReq(Request): + url = 'tb-service/twd-to-twd' + check_params = ['content'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/basic/__init__.py b/dtkApi/basic/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2d906b42b1f8ec3f67d7c0159dd4b8f062f88ef1 --- /dev/null +++ b/dtkApi/basic/__init__.py @@ -0,0 +1,27 @@ +# -*- coding:utf8 -*- + +""" +大淘客开放平台--基础工具API +ActivityLinkReq:官方活动会场转链 +CreatTaokoulingReq:淘口令生成 +FirstOrderGiftMoneyReq:首单礼金 +OrderDetailsReq:淘系订单查询 +ParseContentReq:淘系万能解析 +ParseTaokoulingReq:淘口令解析 +PrivilegeLinkReq:高效转链 +SuperCategoryReq:超级分类 +CollectionListReq:我的收藏 +JdGoodsLinkReq:京东商品转链 +""" + +from dtkApi.basic.ActivityLinkReq import ActivityLinkReq +from dtkApi.basic.CreatTaokoulingReq import CreatTaokoulingReq +from dtkApi.basic.FirstOrderGiftMoneyReq import FirstOrderGiftMoneyReq +from dtkApi.basic.OrderDetailsReq import OrderDetailsReq +from dtkApi.basic.ParseContentReq import ParseContentReq +from dtkApi.basic.ParseTaokoulingReq import ParseTaokoulingReq +from dtkApi.basic.PrivilegeLinkReq import PrivilegeLinkReq +from dtkApi.basic.SuperCategoryReq import SuperCategoryReq +from dtkApi.basic.TwdToTwdReq import TwdToTwdReq +from dtkApi.basic.CollectionListReq import CollectionListReq +from dtkApi.basic.JdGoodsLinkReq import JdGoodsLinkReq diff --git a/dtkApi/basic/__pycache__/ActivityLinkReq.cpython-36.pyc b/dtkApi/basic/__pycache__/ActivityLinkReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b1200cc72d6374d11bfd4d43e02d6bb0f26dd24 Binary files /dev/null and b/dtkApi/basic/__pycache__/ActivityLinkReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/CollectionListReq.cpython-36.pyc b/dtkApi/basic/__pycache__/CollectionListReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..940dbdca88922cac493bf006650e01a1ca7dc4c5 Binary files /dev/null and b/dtkApi/basic/__pycache__/CollectionListReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/CreatTaokoulingReq.cpython-36.pyc b/dtkApi/basic/__pycache__/CreatTaokoulingReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d00d239768f14224df1227c3c40a34e2c607156 Binary files /dev/null and b/dtkApi/basic/__pycache__/CreatTaokoulingReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/FirstOrderGiftMoneyReq.cpython-36.pyc b/dtkApi/basic/__pycache__/FirstOrderGiftMoneyReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..168e8b61036afda92e6bf387c08f4aff253a94ed Binary files /dev/null and b/dtkApi/basic/__pycache__/FirstOrderGiftMoneyReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/JdGoodsLinkReq.cpython-36.pyc b/dtkApi/basic/__pycache__/JdGoodsLinkReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9a8239c253ed51565f03d6e0f52f73d6ca73dfe Binary files /dev/null and b/dtkApi/basic/__pycache__/JdGoodsLinkReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/OrderDetailsReq.cpython-36.pyc b/dtkApi/basic/__pycache__/OrderDetailsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c629299f816ada929e583129f6944fee3965d611 Binary files /dev/null and b/dtkApi/basic/__pycache__/OrderDetailsReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/ParseContentReq.cpython-36.pyc b/dtkApi/basic/__pycache__/ParseContentReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64b55fd13f6ac6c84c726289ea519c01e671e535 Binary files /dev/null and b/dtkApi/basic/__pycache__/ParseContentReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/ParseTaokoulingReq.cpython-36.pyc b/dtkApi/basic/__pycache__/ParseTaokoulingReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e55aa90a7637dec7d9a4878753b761b4f30d10d1 Binary files /dev/null and b/dtkApi/basic/__pycache__/ParseTaokoulingReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/PrivilegeLinkReq.cpython-36.pyc b/dtkApi/basic/__pycache__/PrivilegeLinkReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0625a0dfc20401f20cf85e30fd9d9404a19e7da9 Binary files /dev/null and b/dtkApi/basic/__pycache__/PrivilegeLinkReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/SuperCategoryReq.cpython-36.pyc b/dtkApi/basic/__pycache__/SuperCategoryReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e2be8bec62b5b48b667b8af95f2bef3f6887a5b Binary files /dev/null and b/dtkApi/basic/__pycache__/SuperCategoryReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/TwdToTwdReq.cpython-36.pyc b/dtkApi/basic/__pycache__/TwdToTwdReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fb370ae1389424552dfaf78d7d5581c5cdaa2a0 Binary files /dev/null and b/dtkApi/basic/__pycache__/TwdToTwdReq.cpython-36.pyc differ diff --git a/dtkApi/basic/__pycache__/__init__.cpython-36.pyc b/dtkApi/basic/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2af2ad749127ecbc634f130d87a2b787673264de Binary files /dev/null and b/dtkApi/basic/__pycache__/__init__.cpython-36.pyc differ diff --git a/dtkApi/original/ActivityCatalogueReq.py b/dtkApi/original/ActivityCatalogueReq.py new file mode 100644 index 0000000000000000000000000000000000000000..068ab481d96fc4501b008a1cc100e44ca5b2fdd1 --- /dev/null +++ b/dtkApi/original/ActivityCatalogueReq.py @@ -0,0 +1,16 @@ +# -*- coding:utf8-*- + +""" +热门活动 +""" +from dtkApi.apiRequest import Request + + +class ActivityCatalogueReq(Request): + url = 'goods/activity/catalogue' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/ActivityGoodsListReq.py b/dtkApi/original/ActivityGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..b84b0860e0315b68f70b51ebcdb9cc1ebc731219 --- /dev/null +++ b/dtkApi/original/ActivityGoodsListReq.py @@ -0,0 +1,23 @@ +# -*- coding:utf8-*- + +""" +活动商品 + @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口第一次返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入库商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  pageSize Number 非必须 每页条数,默认为100,大于100按100处理 +  activityId Number 必须 通过热门活动API获取的活动id +  cid Number 非必须 大淘客一级分类ID:1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品,6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺 +  subcid Number 非必须 大淘客二级分类ID:可通过超级分类接口获取二级分类id,当同时传入一级分类id和二级分类id时,以一级分类id为准 +  freeshipRemoteDistrict Number 非必须 偏远地区包邮:1.是,0.否 + +""" +from dtkApi.apiRequest import Request + + +class ActivityGoodsListReq(Request): + url = 'goods/activity/goods-list' + check_params = ['pageId','activityId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/BrandListReq.py b/dtkApi/original/BrandListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..d5fe44479d6c8c7237dee89d67b049ebe77ba88f --- /dev/null +++ b/dtkApi/original/BrandListReq.py @@ -0,0 +1,18 @@ +# -*- coding:utf8-*- + +""" +品牌库 +@pageId String 必须 页码 +@pageSize Number 非必须 每页条数,默认为20,最大值100 +""" +from dtkApi.apiRequest import Request + + +class BrandListReq(Request): + url = 'tb-service/get-brand-list' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/CatalogueReq.py b/dtkApi/original/CatalogueReq.py new file mode 100644 index 0000000000000000000000000000000000000000..835d1b881c37fd0e2eee0730ad6fd9a64428bff3 --- /dev/null +++ b/dtkApi/original/CatalogueReq.py @@ -0,0 +1,16 @@ +# -*- coding:utf8-*- +""" +精选专题 +""" + +from dtkApi.apiRequest import Request + + +class CatalogueReq(Request): + url = 'goods/topic/catalogue' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/DdqGoodsListReq.py b/dtkApi/original/DdqGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..6e4d3c79ff89df3afdb78ef7cdc2fa137c5b0376 --- /dev/null +++ b/dtkApi/original/DdqGoodsListReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- +""" +咚咚抢 + @roundTime String 非必须 默认为当前场次,场次时间输入方式:yyyy-mm-dd hh:mm:ss + +""" +from dtkApi.apiRequest import Request + + +class DdqGoodsListReq(Request): + url = 'category/ddq-goods-list' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/ExclusiveGoodsListReq.py b/dtkApi/original/ExclusiveGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..74096e6bff797985aa15fd72900542cbb8374dc6 --- /dev/null +++ b/dtkApi/original/ExclusiveGoodsListReq.py @@ -0,0 +1,20 @@ +# -*- coding:utf8-*- + +""" +大淘客独家券商品 + @pageSize Number 必须 每页返回条数,每页条数支持输入10,20,50,100。默认50条 + @pageId String 必须 分页id:常规分页方式,请直接传入对应页码(比如:1,2,3……) + @cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。 + @sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +""" +from dtkApi.apiRequest import Request + + +class ExclusiveGoodsListReq(Request): + url = 'goods/exclusive-goods-list' + check_params = ['pageId','pageSize'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/ExplosiveGoodsListReq.py b/dtkApi/original/ExplosiveGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..f7c575cfb04a2189a61c6956ad07dd662b940953 --- /dev/null +++ b/dtkApi/original/ExplosiveGoodsListReq.py @@ -0,0 +1,19 @@ +# -*- coding:utf8-*- +""" +每日爆品推荐 +  @pageId String 必须 分页id:常规分页方式,请直接传入对应页码(比如:1,2,3……) +  @pageSize Number 必须 每页返回条数,每页条数支持输入10,20,50,100。默认50条 +  @PriceCid String 非必须 价格区间,1表示10~20元区;2表示20~40元区;3表示40元以上区;默认为1 +  @cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品,6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺。不填默认全部 +""" +from dtkApi.apiRequest import Request + + +class ExplosiveGoodsListReq(Request): + url = 'goods/explosive-goods-list' + check_params = ['pageId','pageSize'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/FriendsCircleListReq.py b/dtkApi/original/FriendsCircleListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..f10f83fc318734d98b2a0af7895b1875b1b44f81 --- /dev/null +++ b/dtkApi/original/FriendsCircleListReq.py @@ -0,0 +1,25 @@ +# -*- coding:utf8-*- + +""" +朋友圈文案 +  @pageSize Number 非必须 每页条数,默认为100,若小于10,则按10条处理,每页条数仅支持输入10,50,100 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式 +  @sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +  @cid String 非必须 大淘客的一级分类id,如6、4 +  @subcid String 非必须 大淘客的二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @pre Number 非必须 是否预告商品,1-预告商品,0-所有商品,不填默认为0 +  @freeshipRemoteDistrict Number 非必须 偏远地区包邮,1-是,0-非偏远地区,不填默认所有商品 +  @goodsId Number 非必须 大淘客id或淘宝id,查询单个商品是否有朋友圈文案,如果有,则返回商品信息及朋友圈文案,如果没有,显示10006错误 + +""" +from dtkApi.apiRequest import Request + + +class FriendsCircleListReq(Request): + url = 'goods/friends-circle-list' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/GoodspriceTrendReq.py b/dtkApi/original/GoodspriceTrendReq.py new file mode 100644 index 0000000000000000000000000000000000000000..c17bc270071d4fbe07715f0d06cbb7d93a633b2b --- /dev/null +++ b/dtkApi/original/GoodspriceTrendReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- +""" +商品历史券后价 + @id String 必须 在大淘客的在线商品id(已下架的商品id不支持) + @goodsId String 非必须 淘宝商品id +""" +from dtkApi.apiRequest import Request + + +class GoodspriceTrendReq(Request): + url = 'goods/price-trend' + check_params = ['id'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/ListSimilerGoodsByOpenReq.py b/dtkApi/original/ListSimilerGoodsByOpenReq.py new file mode 100644 index 0000000000000000000000000000000000000000..a80202fe7b6ed76a995329dfea78e402fa9af527 --- /dev/null +++ b/dtkApi/original/ListSimilerGoodsByOpenReq.py @@ -0,0 +1,18 @@ +# -*- coding:utf8-*- + +""" +猜你喜欢 + @id Number 必须 大淘客的商品id + @size Number 非必须 每页条数,默认10 , 最大值100 +""" +from dtkApi.apiRequest import Request + + +class ListSimilerGoodsByOpenReq(Request): + url = 'goods/list-similer-goods-by-open' + check_params = ['id'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/LiveMaterialGoodsListReq.py b/dtkApi/original/LiveMaterialGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..10478dde57ee9b43eb2c5d770b99a7cf7ced7760 --- /dev/null +++ b/dtkApi/original/LiveMaterialGoodsListReq.py @@ -0,0 +1,18 @@ +# -*- coding:utf8-*- + +""" +直播好货 + @date String 非必须 选择某一天的直播商品数据,默认返回全部参与过直播,且未下架的商品。时间格式:2020-09-16 + @sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +""" +from dtkApi.apiRequest import Request + + +class LiveMaterialGoodsListReq(Request): + url = 'goods/liveMaterial-goods-list' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/OpGoodsListReq.py b/dtkApi/original/OpGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..959724df086d0ea950228d8f3003619033eaa90b --- /dev/null +++ b/dtkApi/original/OpGoodsListReq.py @@ -0,0 +1,20 @@ +# -*- coding:utf8-*- + +""" +9.9包邮精选 +  @pageSize Number 必须 每页条数:默认为20,最大值100 +  @pageId String 必须 分页id:常规分页方式,请直接传入对应页码(比如:1,2,3……) +  @nineCid String 必须 9.9精选的类目id,分类id请求详情:-1-精选,1 -5.9元区,2 -9.9元区,3 -19.9元区(调整字段) + +""" +from dtkApi.apiRequest import Request + + +class OpGoodsListReq(Request): + url = 'nine/op-goods-list' + check_params = ['pageId','pageSize','nineCid'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/RankingListReq.py b/dtkApi/original/RankingListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..22db4f9927c8ea3fbd2bd738742657395f2277e5 --- /dev/null +++ b/dtkApi/original/RankingListReq.py @@ -0,0 +1,21 @@ +# -*- coding:utf8-*- + +""" +各大榜单 +  @rankType Number 必须 榜单类型,1.实时榜 2.全天榜 3.热推榜 4.复购榜 5.热词飙升榜 6.热词排行榜 7.综合热搜榜 +  @cid Number 非必须 大淘客一级类目id,仅对实时榜单、全天榜单有效 +  @pageSize Number 非必须 每页条数返回条数(支持10,20.50,默认返回20条) +  @pageId String 非必须 分页id:常规分页方式,请直接传入对应页码(比如:1,2,3……)。超过200条,分页返回为空 + +""" +from dtkApi.apiRequest import Request + + +class RankingListReq(Request): + url = 'goods/get-ranking-list' + check_params = ['rankType'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/TbTopicListReq.py b/dtkApi/original/TbTopicListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..4598d5c50e3847c9de4fd1e4b233022d3914c02d --- /dev/null +++ b/dtkApi/original/TbTopicListReq.py @@ -0,0 +1,19 @@ +# -*- coding:utf8-*- +""" +官方活动(1元购) +  pageId String 必须 分页id,支持传统的页码分页方式 +  pageSize Number 非必须 每页条数,默认为20 +  type Number 非必须 输出的端口类型:0.全部(默认),1.PC,2.无线 +  channelID Number 非必须 阿里妈妈上申请的渠道id +""" +from dtkApi.apiRequest import Request + + +class TbTopicListReq(Request): + url = 'category/get-tb-topic-list' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/TopicGoodsListReq.py b/dtkApi/original/TopicGoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..b6a3bad0c1c86f1a59bc88ab6c8932338a1d897b --- /dev/null +++ b/dtkApi/original/TopicGoodsListReq.py @@ -0,0 +1,19 @@ +# -*- coding:utf8-*- +""" +专题商品 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口第一次返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入库商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  @pageSize Number 非必须 每页条数,默认为100,大于100按100处理 +  @topicId Number 必须 专辑id,通过精选专辑API获取的活动id + +""" +from dtkApi.apiRequest import Request + + +class TopicGoodsListReq(Request): + url = 'goods/topic/goods-list' + check_params = ['pageId','topicId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/original/__init__.py b/dtkApi/original/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..c78064b4bc540ad5aff2f1d940659d29c483a73d --- /dev/null +++ b/dtkApi/original/__init__.py @@ -0,0 +1,35 @@ +# -*- coding:utf8 -*- +""" +TbTopicListReq:官方活动(1元购) +DdqGoodsListReq:咚咚抢 +RankingListReq:各大榜单 +CatalogueReq:精选专题 +TopicGoodsListReq:专题商品 +OpGoodsListReq:9.9包邮精选 +BrandListReq:品牌库 +ListSimilerGoodsByOpenReq:猜你喜欢 +ActivityGoodsListReq:活动商品 +ActivityCatalogueReq:热门活动 +LiveMaterialGoodsListReq:直播好货 +ExplosiveGoodsListReq:每日爆品推荐 +ExclusiveGoodsListReq:大淘客独家券商品 +FriendsCircleListReq:朋友圈文案商品 +GoodspriceTrendReq:商品历史券后价 +""" + + +from dtkApi.original.TbTopicListReq import TbTopicListReq +from dtkApi.original.DdqGoodsListReq import DdqGoodsListReq +from dtkApi.original.RankingListReq import RankingListReq +from dtkApi.original.CatalogueReq import CatalogueReq +from dtkApi.original.TopicGoodsListReq import TopicGoodsListReq +from dtkApi.original.OpGoodsListReq import OpGoodsListReq +from dtkApi.original.BrandListReq import BrandListReq +from dtkApi.original.ListSimilerGoodsByOpenReq import ListSimilerGoodsByOpenReq +from dtkApi.original.ActivityGoodsListReq import ActivityGoodsListReq +from dtkApi.original.ActivityCatalogueReq import ActivityCatalogueReq +from dtkApi.original.LiveMaterialGoodsListReq import LiveMaterialGoodsListReq +from dtkApi.original.ExplosiveGoodsListReq import ExplosiveGoodsListReq +from dtkApi.original.ExclusiveGoodsListReq import ExclusiveGoodsListReq +from dtkApi.original.FriendsCircleListReq import FriendsCircleListReq +from dtkApi.original.GoodspriceTrendReq import GoodspriceTrendReq diff --git a/dtkApi/save/GoodsByTimeReq.py b/dtkApi/save/GoodsByTimeReq.py new file mode 100644 index 0000000000000000000000000000000000000000..4d3939e7e0346a090bf6eb6e74bd05f224e50012 --- /dev/null +++ b/dtkApi/save/GoodsByTimeReq.py @@ -0,0 +1,26 @@ +# -*- coding:utf8-*- +""" +定时拉取 +  @pageSize Number 非必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  @cid String 非必须 大淘客的一级分类id。当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @subcid Number 非必须 大淘客的二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @pre Number 非必须 是否预告商品,1-预告商品,0-所有商品,不填默认为0 +  @sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从新到旧,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +  @startTime String 非必须 开始时间,格式为yyyy-mm-dd hh:mm:ss,商品上架的时间大于等于开始时间 +  @endTime String 非必须 结束时间,默认为请求的时间,商品上架的时间小于等于结束时间 +  @freeshipRemoteDistrict Number 非必须 偏远地区包邮,1-是,0-非偏远地区,不填默认所有商品 +  @choice Number 非必须 是否为精选商品,默认全部商品,1-精选商品(3.19新增字段) + +""" +from dtkApi.apiRequest import Request + + +class GoodsByTimeReq(Request): + url = 'goods/pull-goods-by-time' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/GoodsDetailsReq.py b/dtkApi/save/GoodsDetailsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..2299a2ce334ccede5fd6b405a267786c8e352955 --- /dev/null +++ b/dtkApi/save/GoodsDetailsReq.py @@ -0,0 +1,18 @@ +# -*- coding:utf8-*- + +""" +单品详情 +  @id Number 必须 大淘客商品id,请求时id或goodsId必填其中一个,若均填写,将优先查找当前单品id +  @goodsId String 非必须 淘宝商品id,id或goodsId必填其中一个,若均填写,将优先查找当前单品id +""" +from dtkApi.apiRequest import Request + + +class GoodsDetailsReq(Request): + url = 'goods/get-goods-details' + check_params = ['id'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/GoodsListReq.py b/dtkApi/save/GoodsListReq.py new file mode 100644 index 0000000000000000000000000000000000000000..9104c85b54b60a0f550337ab86a85158d7ea5232 --- /dev/null +++ b/dtkApi/save/GoodsListReq.py @@ -0,0 +1,41 @@ +# -*- coding:utf8-*- + +""" +商品列表 +  @pageId String 必须 默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  @pageSize Number 非必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +  @sort String 非必须 排序方式,默认为0,0-综合排序,1-商品上架时间从高到低,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +  @cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @subcid Number 非必须 大淘客的二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @specialId Number 非必须 商品卖点,1.拍多件活动;2.多买多送;3.限量抢购;4.额外满减;6.买商品礼赠 +  @juHuaSuan Number 非必须 1-聚划算商品,0-所有商品,不填默认为0 +  @taoQiangGou Number 非必须 1-淘抢购商品,0-所有商品,不填默认为0 +  @tmall Number 非必须 1-天猫商品, 0-非天猫商品,不填默认所有商品 +  @tchaoshi Number 非必须 1-天猫超市商品, 0-所有商品,不填默认为0 +  @goldSeller Number 非必须 1-金牌卖家商品,0-所有商品,不填默认为0 +  @haitao Number 非必须 1-海淘商品, 0-所有商品,不填默认为0 +  @pre Number 非必须 1-预告商品,0-所有商品,不填默认为0 +  @preSale Number 非必须 1-活动预售商品,0-所有商品,不填默认为0。(10.30新增字段) +  @brand Number 非必须 1-品牌商品,0-所有商品,不填默认为0 +  @brandIds Number 非必须 当brand传入0时,再传入brandIds可能无法获取结果。品牌id可以传多个,以英文逗号隔开,如:”345,321,323” +  @priceLowerLimit Number 非必须 价格(券后价)下限 +  @priceUpperLimit Number 非必须 价格(券后价)上限 +  @couponPriceLowerLimit Number 非必须 最低优惠券面额 +  @commissionRateLowerLimit Number 非必须 最低佣金比率 +  @monthSalesLowerLimit Number 非必须 最低月销量 +  @freeshipRemoteDistrict Number 非必须 偏远地区包邮,1-是,0-非偏远地区,不填默认所有商品 +  @directCommissionType Number 非必须 定向佣金类型,3查询定向佣金商品,否则查询全部商品(12.22新增字段) +  @choice Number 非必须 是否为精选商品,默认全部,1-精选商品(3.19新增字段) + +""" +from dtkApi.apiRequest import Request + + +class GoodsListReq(Request): + url = 'goods/get-goods-list' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/JdGoodsDetaillReq.py b/dtkApi/save/JdGoodsDetaillReq.py new file mode 100644 index 0000000000000000000000000000000000000000..a9ca0185f5d5f5aba3a74efabad8826352e06124 --- /dev/null +++ b/dtkApi/save/JdGoodsDetaillReq.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- + +""" +京东商品详情 + @skuIds String 必须 商品skuId,多个使用逗号分隔,最多支持10个skuId同时查询(需使用半角状态下的逗号) +""" +from dtkApi.apiRequest import Request + + +class JdGoodsDetaillReq(Request): + url = 'dels/jd/goods/get-details' + check_params = ['skuIds'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/NewestGoodsReq.py b/dtkApi/save/NewestGoodsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..fa19cf8ce35191988f448dc2fe427ce228232238 --- /dev/null +++ b/dtkApi/save/NewestGoodsReq.py @@ -0,0 +1,38 @@ +# -*- coding:utf8-*- + +""" +商品更新 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  @pageSize Number 必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +  @startTime Date 非必须 商品上架开始时间,请求格式:yyyy-MM-dd HH:mm:ss +  @endTime Date 非必须 商品上架结束时间,请求格式:yyyy-MM-dd HH:mm:ss +  @cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。当一级类目id和二级类目id同时传入时,会自动忽略二级类目id,1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品,6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺 +  @subcid Number 非必须 大淘客的二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @juHuaSuan Number 非必须 1-聚划算商品,0-所有商品,不填默认为0 +  @taoQiangGou Number 非必须 1-淘抢购商品,0-所有商品,不填默认为0 +  @tmall Number 非必须 1-天猫商品,0-非天猫商品,不填默认全部商品 +  @tchaoshi Number 非必须 1-天猫超市商品,0-所有商品,不填默认为0 +  @goldSeller Number 非必须 1-金牌卖家,0-所有商品,不填默认为0 +  @haitao Number 非必须 1-海淘,0-所有商品,不填默认为0 +  @brand Number 非必须 1-品牌,0-所有商品,不填默认为0 +  @brandIds String 非必须 品牌id,当brand传入0时,再传入brandIds将获取不到结果。品牌id可以传多个,以英文逗号隔开,如:”345,321,323” +  @preSale Number 非必须 1-活动预售商品,0-所有商品,不填默认为0。(2020.10.30号新增字段) +  @priceLowerLimit Number 非必须 价格(券后价)下限 +  @priceUpperLimit Number 非必须 价格(券后价)上限 +  @couponPriceLowerLimit Number 非必须 最低优惠券面额 +  @commissionRateLowerLimit Number 非必须 最低佣金比率 +  @monthSalesLowerLimit Number 非必须 最低月销量 +  @sort String 非必须 排序字段,默认为0,0-综合排序,1-商品上架时间从新到旧,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 + +""" +from dtkApi.apiRequest import Request + + +class NewestGoodsReq(Request): + url = 'goods/get-newest-goods' + check_params = ['pageId','pageSize'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/StaleGoodsByTimeReq.py b/dtkApi/save/StaleGoodsByTimeReq.py new file mode 100644 index 0000000000000000000000000000000000000000..f35a4d293894f07e2623f83eccef4cb272f5a5e3 --- /dev/null +++ b/dtkApi/save/StaleGoodsByTimeReq.py @@ -0,0 +1,19 @@ +# -*- coding:utf8-*- +""" +失效商品 +  @pageSize Number 非必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) 建议方式:第一页的时候,pegeId传1,当请求后会返回pageId字符串,第二页一直到后面的所有翻页都使用这个pageId的字符串就可以了 +  @startTime String 非必须 开始时间,默认为yyyy-mm-dd hh:mm:ss,商品下架的时间大于等于开始时间,开始时间需要在当日 +  @endTime String 非必须 结束时间,默认为请求的时间,商品下架的时间小于等于结束时间,结束时间需要在当日 +""" +from dtkApi.apiRequest import Request + + +class StaleGoodsByTimeReq(Request): + url = 'goods/get-stale-goods-by-time' + check_params = ['pageId'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/save/__init__.py b/dtkApi/save/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c3d8a733f6a2d909fb99f3b16f77af42adbcf4d --- /dev/null +++ b/dtkApi/save/__init__.py @@ -0,0 +1,17 @@ +# -*- coding:utf8 -*- + +""" +GoodsListReq:商品列表 +GoodsByTimeReq:定时拉取 +GoodsDetailsReq:单品详情 +NewestGoodsReq:商品更新 +StaleGoodsByTimeReq:失效商品 +JdGoodsDetaillReq:京东商品详情 +""" + +from dtkApi.save.GoodsListReq import GoodsListReq +from dtkApi.save.GoodsByTimeReq import GoodsByTimeReq +from dtkApi.save.GoodsDetailsReq import GoodsDetailsReq +from dtkApi.save.NewestGoodsReq import NewestGoodsReq +from dtkApi.save.StaleGoodsByTimeReq import StaleGoodsByTimeReq +from dtkApi.save.JdGoodsDetaillReq import JdGoodsDetaillReq diff --git a/dtkApi/save/__pycache__/GoodsByTimeReq.cpython-36.pyc b/dtkApi/save/__pycache__/GoodsByTimeReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9735c44acd846456919603cd48d559b1feb8c4bd Binary files /dev/null and b/dtkApi/save/__pycache__/GoodsByTimeReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/GoodsDetailsReq.cpython-36.pyc b/dtkApi/save/__pycache__/GoodsDetailsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..15b7124311680ba9f818cc5a2706ce81cd1a7a05 Binary files /dev/null and b/dtkApi/save/__pycache__/GoodsDetailsReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/GoodsListReq.cpython-36.pyc b/dtkApi/save/__pycache__/GoodsListReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f55d8088acbdae68783f0ccf10a9a4f50fd5af0b Binary files /dev/null and b/dtkApi/save/__pycache__/GoodsListReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/JdGoodsDetaillReq.cpython-36.pyc b/dtkApi/save/__pycache__/JdGoodsDetaillReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f925c48a836eca4118c6bdfd991d61fccc7f55c1 Binary files /dev/null and b/dtkApi/save/__pycache__/JdGoodsDetaillReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/NewestGoodsReq.cpython-36.pyc b/dtkApi/save/__pycache__/NewestGoodsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0096ed022ffb32cc7fc100a25d2275a8edd18b35 Binary files /dev/null and b/dtkApi/save/__pycache__/NewestGoodsReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/StaleGoodsByTimeReq.cpython-36.pyc b/dtkApi/save/__pycache__/StaleGoodsByTimeReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..01a4d8eb4edfb49443b87062161eada65fb20f37 Binary files /dev/null and b/dtkApi/save/__pycache__/StaleGoodsByTimeReq.cpython-36.pyc differ diff --git a/dtkApi/save/__pycache__/__init__.cpython-36.pyc b/dtkApi/save/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84a41e34dd66a8039ff47f81da48031c96fccc04 Binary files /dev/null and b/dtkApi/save/__pycache__/__init__.cpython-36.pyc differ diff --git a/dtkApi/search/DtkSearchGoodsReq.py b/dtkApi/search/DtkSearchGoodsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..20d0a32cdf0c7543d35476f090bce00280d4b46e --- /dev/null +++ b/dtkApi/search/DtkSearchGoodsReq.py @@ -0,0 +1,36 @@ +# -*- coding:utf8-*- + +""" +  @pageSize Number 必须 每页条数,默认为100,最大值200,若小于10,则按10条处理,每页条数仅支持输入10,50,100,200 +  @pageId String 必须 分页id,默认为1,支持传统的页码分页方式和scroll_id分页方式,根据用户自身需求传入值。示例1:商品入库,则首次传入1,后续传入接口返回的pageid,接口将持续返回符合条件的完整商品列表,该方式可以避免入口商品重复;示例2:根据pagesize和totalNum计算出总页数,按照需求返回指定页的商品(该方式可能在临近页取到重复商品) +  @keyWords String 必须 关键词搜索 +  @cids String 非必须 大淘客的一级分类id,如果需要传多个,以英文逗号相隔,如:”1,2,3”。当一级类目id和二级类目id同时传入时,会自动忽略二级类目id,一级分类id请求详情:1 -女装,2 -母婴,3 -美妆,4 -居家日用,5 -鞋品,6 -美食,7 -文娱车品,8 -数码家电,9 -男装,10 -内衣,11 -箱包,12 -配饰,13 -户外运动,14 -家装家纺 +  @subcid Number 非必须 大淘客的二级类目id,通过超级分类API获取。仅允许传一个二级id,当一级类目id和二级类目id同时传入时,会自动忽略二级类目id +  @juHuaSuan Number 非必须 是否聚划算,1-聚划算商品,0-所有商品,不填默认为0 +  @taoQiangGou Number 非必须 是否淘抢购,1-淘抢购商品,0-所有商品,不填默认为0 +  @tmall Number 非必须 是否天猫商品,1-天猫商品,0-非天猫商品,不填默认为所有商品 +  @tchaoshi Number 非必须 是否天猫超市商品,1-天猫超市商品,0-所有商品,不填默认为0 +  @goldSeller Number 非必须 是否金牌卖家,1-金牌卖家,0-所有商品,不填默认为0 +  @haitao Number 非必须 是否海淘商品,1-海淘商品,0-所有商品,不填默认为0 +  @brand Number 非必须 是否品牌商品,1-品牌商品,0-所有商品,不填默认为0 +  @brandIds String 非必须 品牌id,当brand传入0时,再传入brandIds将获取不到结果。品牌id可以传多个,以英文逗号隔开,如:”345,321,323” +  @priceLowerLimit Number 非必须 价格(券后价)下限 +  @priceUpperLimit Number 非必须 价格(券后价)上限 +  @couponPriceLowerLimit Number 非必须 最低优惠券面额 +  @commissionRateLowerLimit Number 非必须 最低佣金比率 +  @monthSalesLowerLimit Number 非必须 最低月销量 +  @sort String 非必须 排序字段,默认为0,0-综合排序,1-商品上架时间从新到旧,2-销量从高到低,3-领券量从高到低,4-佣金比例从高到低,5-价格(券后价)从高到低,6-价格(券后价)从低到高 +  @freeshipRemoteDistrict Number 非必须 偏远地区包邮,1-是,0-非偏远地区,不填默认所有商品 + +""" +from dtkApi.apiRequest import Request + + +class DtkSearchGoodsReq(Request): + url = 'goods/get-dtk-search-goods' + check_params = ['pageId','pageSize','keyWords'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/JdGoodsReq.py b/dtkApi/search/JdGoodsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..6c12ddbd3299137255705e50d72b95a98cb62f46 --- /dev/null +++ b/dtkApi/search/JdGoodsReq.py @@ -0,0 +1,42 @@ +# -*- coding:utf8-*- + +""" +京东联盟搜索 +  @cid1 Long 否 一级类目id +  @cid2 Long 否 二级类目id +  @cid3 Long 否 三级类目id +  @pageId Integer 否 页码 +  @pageSize Integer 否 每页数量,单页数最大30,默认20 +  @skuIds String 否 skuid集合(一次最多支持查询100个sku),多个使用“,”分隔符 +  @keyword String 否 关键词,字数同京东商品名称一致,目前未限制 +  @priceFrom BigDecimal 否 商品券后价格下限 +  @priceTo BigDecimal 否 商品券后价格上限 +  @commissionShareStart Integer 否 佣金比例区间开始 +  @commissionShareEnd Integer 否 佣金比例区间结束 +  @owner String 否 商品类型:自营[g],POP[p] +  @sortName String 否 排序字段(price:单价, commissionShare:佣金比例, commission:佣金, inOrderCount30Days:30天引单量, inOrderComm30Days:30天支出佣金) +  @sort String 否 asc:升序;desc:降序。默认降序 +  @isCoupon Integer 否 是否是优惠券商品,1:有优惠券,0:无优惠券 +  @pingouPriceStart BigDecimal 否 拼购价格区间开始 +  @pingouPriceEnd BigDecimal 否 拼购价格区间结束 +  @brandCode String 否 品牌code +  @shopId Integer 否 店铺Id +  @hasBestCoupon Integer 否 1:查询有最优惠券商品;其他值过滤掉此入参条件。(查询最优券需与isCoupon同时使用) +  @pid String 否 联盟id_应用iD_推广位id +  @jxFlags String 否 京喜商品类型,1京喜、2京喜工厂直供、3京喜优选(包含3时可在京东APP购买),入参多个值表示或条件查询 +  @spuId Long 否 主商品spuId +  @couponUrl String 否 优惠券链接 +  @deliveryType Integer 否 京东配送 1:是,0:不是 + +""" +from dtkApi.apiRequest import Request + + +class JdGoodsReq(Request): + url = 'dels/jd/goods/search' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/ListHotWordsReq.py b/dtkApi/search/ListHotWordsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..f08cbd29add9f803e75aebea019c7a4b3d7bfcda --- /dev/null +++ b/dtkApi/search/ListHotWordsReq.py @@ -0,0 +1,16 @@ +# -*- coding:utf8-*- + +""" +热搜榜 +""" +from dtkApi.apiRequest import Request + + +class ListHotWordsReq(Request): + url = 'etc/search/list-hot-words' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/PddGoodsReq.py b/dtkApi/search/PddGoodsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..1e3df4a643921e4dc281d6e39dd1271598e86210 --- /dev/null +++ b/dtkApi/search/PddGoodsReq.py @@ -0,0 +1,32 @@ +# -*- coding:utf8-*- + +""" +拼多多联盟搜索 +  @activityTags String 否 活动商品标记数组,例:[4,7], 4-秒杀,7-百亿补贴,31-品牌黑标,10564-精选爆品-官方直推爆款,10584-精选爆品-团长推荐, 24-品牌高佣,20-行业精选,21-金牌商家,10044-潜力爆品,10475-爆品上新,其他的值请忽略 +  @blockCats String 否 自定义屏蔽一级/二级/三级类目ID,自定义数量不超过20个; +  @blockCatPackages String 否 屏蔽商品类目包:1-拼多多小程序屏蔽的类目&关键词;2-虚拟类目;3-医疗器械;4-处方药;5-非处方药 +  @catId Number 否 商品类目ID +  @goodsSignList String 否 商品goodsSign列表 访问括号内链接可查看字段相关说明(http://www.dataoke.com/kfpt/open-gz.html?id=100) +  @isBrandGoods Integer 否 是否为品牌商品 +  @keyword String 否 商品关键词(暂不支持goodid进行搜索,如需定向搜索商品建议使用goodsign进行搜索) +  @listId String 否 翻页时建议填写前页返回的list_id值 +  @merchantTypeList String 否 店铺类型数组 1-个人,2-企业,3-旗舰店,4-专卖店,5-专营店,6-普通店(未传为全部) +  @optId Number 否 商品标签类目ID +  @page Integer 否 默认值1,商品分页数 +  @pageSize Integer 否 默认100,每页商品数量 +  @rangeList String 否 筛选范围列表 样例:[{"range_id":0,"range_from":1,"range_to":1500}, {"range_id":1,"range_from":1,"range_to":1500}] +  @sortType Integer 否 排序方式:0-综合排序;2-按佣金比例降序;3-按价格升序;4-按价格降序;6-按销量降序;9-券后价升序排序;10-券后价降序排序;16-店铺描述评分降序 +  @withCoupon Integer 否 是否只返回优惠券的商品,0返回所有商品,1只返回有优惠券的商品 + +""" +from dtkApi.apiRequest import Request + + +class PddGoodsReq(Request): + url = 'dels/pdd/goods/search' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/SuggestionReq.py b/dtkApi/search/SuggestionReq.py new file mode 100644 index 0000000000000000000000000000000000000000..6fa8eb17baf8cfe73a683a47d1b3fc56e99d074b --- /dev/null +++ b/dtkApi/search/SuggestionReq.py @@ -0,0 +1,19 @@ +# -*- coding:utf8-*- + +""" +联想词 +  @keyWords String 必须 关键词 +  @type Number 必须 当前搜索API类型:1.大淘客搜索 2.联盟搜索 3.超级搜索 + +""" +from dtkApi.apiRequest import Request + + +class SuggestionReq(Request): + url = 'goods/search-suggestion' + check_params = ['keyWords','type'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/SuperGoodsReq.py b/dtkApi/search/SuperGoodsReq.py new file mode 100644 index 0000000000000000000000000000000000000000..eb4f13040f01c1c513234c318d6279ed6f637449 --- /dev/null +++ b/dtkApi/search/SuperGoodsReq.py @@ -0,0 +1,31 @@ +# -*- coding:utf8-*- + +""" +超级搜索 +  @type Number 必须 搜索类型:0-综合结果,1-大淘客商品,2-联盟商品 +  @pageId Number 必须 请求的页码,默认参数1 +  @pageSize Number 必须 每页条数,默认为20,最大值100 +  @keyWords string 必须 关键词搜索 +  @tmall Number 非必须 是否天猫商品:1-天猫商品,0-所有商品,不填默认为0 +  @haitao Number 非必须 是否海淘商品:1-海淘商品,0-所有商品,不填默认为0 +  @sort Number 非必须 排序字段信息 销量(total_sales) 价格(price),排序_des(降序),排序_asc(升序),示例:升序查询销量total_sales_asc 新增排序字段和排序方式,默认为0,0-综合排序,1-销量从高到低,2-销量从低到高,3-佣金比例从低到高,4-佣金比例从高到低,5-价格从高到低,6-价格从低到高(2021/1/15新增字段,之前的排序方式也可以使用) +  @specialId string 非必须 会员运营id +  @channelId string 非必须 渠道id将会和传入的pid进行验证,验证通过将正常转链,请确认填入的渠道id是正确的channelId对应联盟的relationId +  @priceLowerLimit string 非必须 商品券后价下限(2021/1/15新增字段) +  @priceUpperLimit string 非必须 商品券后价上限(2021/1/15新增字段) +  @endTkRate string 非必须 淘客佣金比率上限(2021/1/15新增字段) +  @startTkRate string 非必须 淘客佣金比率下限(2021/1/15新增字段) +  @hasCoupon string 非必须 是否有券,1为有券,默认为全部(2021/1/15新增字段) + +""" +from dtkApi.apiRequest import Request + + +class SuperGoodsReq(Request): + url = 'goods/list-super-goods' + check_params = ['pageId','pageSize','type','keyWords'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/TbServiceReq.py b/dtkApi/search/TbServiceReq.py new file mode 100644 index 0000000000000000000000000000000000000000..ea86221831f1e9d71b3f3fa0fe8f0456284d07ea --- /dev/null +++ b/dtkApi/search/TbServiceReq.py @@ -0,0 +1,32 @@ +# -*- coding:utf8-*- +""" +联盟搜索 +  @pageNo Number 必须 第几页,默认1 +  @pageSize Number 必须 每页条数, 默认20,范围值1~100 +  @keyWords String 必须 查询词 +  @sort String 非必须 排序指标:销量(total_sales),淘客佣金比率(tk_rate), 累计推广量(tk_total_sales),总支出佣金(tk_total_commi),价格(price),排序方式:排序_des(降序),排序_asc(升序),示例:升序查询销量:total_sales_asc +  @source Number 非必须 是否商城商品,设置为1表示该商品是属于淘宝商城商品,设置为非1或不设置表示不判断这个属性(和overseas字段冲突,若已请求source,请勿再请求overseas) +  @overseas Number 非必须 是否海外商品,设置为1表示该商品是属于海外商品,设置为非1或不设置表示不判断这个属性(和source字段冲突,若已请求overseas,请勿再请求source) +  @endPrice Number 非必须 折扣价范围上限,单位:元 +  @startPrice Number 非必须 折扣价范围下限,单位:元 +  @startTkRate Number 非必须 媒体淘客佣金比率下限,如:1234表示12.34% +  @endTkRate Number 非必须 商品筛选-淘客佣金比率上限,如:1234表示12.34% +  @hasCoupon Boolean 非必须 是否有优惠券,设置为true表示该商品有优惠券,设置为false或不设置表示不判断这个属性 +  @specialId string 非必须 会员运营id +  @channelId string 非必须 渠道id将会和传入的pid进行验证,验证通过将正常转链,请确认填入的渠道id是正确的channelId对应联盟的relationId +  @itemLoc string 非必须 商品所在地,默认为全部商品,其他值:北京、上海、广州等必须是城市名称,不能带省份(2021/1/15新增字段) +  @needPrepay string 非必须 商品是否加入消费者保障,1为加入消费者保障,默认全部(2021/1/15新增字段) +  @includeGoodRate string 非必须 商品好评率是否高于行业均值,1为高于行业均值,默认全部(2021/1/15新增字段) + +""" +from dtkApi.apiRequest import Request + + +class TbServiceReq(Request): + url = 'tb-service/get-tb-service' + check_params = ['pageNo','pageSize','keyWords'] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/Top100Req.py b/dtkApi/search/Top100Req.py new file mode 100644 index 0000000000000000000000000000000000000000..b25558c2b0a3e607ddad6c82b721410f84a6e5fd --- /dev/null +++ b/dtkApi/search/Top100Req.py @@ -0,0 +1,17 @@ +# -*- coding:utf8-*- + +""" +热搜榜 + @type Integer 非必须 1:买家热搜榜(默认)、2:淘客热搜榜 +""" +from dtkApi.apiRequest import Request + + +class Top100Req(Request): + url = 'category/get-top100' + check_params = [] + + # GET请求 + def getResponse(self): + if self.check_args(self.params, self.check_params): + return self.request('GET', api_url=self.url, args=self.params) diff --git a/dtkApi/search/__init__.py b/dtkApi/search/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e07aea274f6e4d31b5730985efaf92ea4b4e7b3b --- /dev/null +++ b/dtkApi/search/__init__.py @@ -0,0 +1,20 @@ +# -*- coding:utf8 -*- + +""" +DtkSearchGoodsReq:大淘客搜索 +SuggestionReq:联想词 +SuperGoodsReq:超级搜索 +TbServiceReq:联盟搜索 +Top100Req:热搜记录 +ListHotWordsReq:热搜榜 +PddGoodsReq:拼多多联盟搜索 +JdGoodsReq:京东联盟搜索 +""" +from dtkApi.search.DtkSearchGoodsReq import DtkSearchGoodsReq +from dtkApi.search.SuggestionReq import SuggestionReq +from dtkApi.search.SuperGoodsReq import SuperGoodsReq +from dtkApi.search.TbServiceReq import TbServiceReq +from dtkApi.search.Top100Req import Top100Req +from dtkApi.search.ListHotWordsReq import ListHotWordsReq +from dtkApi.search.PddGoodsReq import PddGoodsReq +from dtkApi.search.JdGoodsReq import JdGoodsReq diff --git a/dtkApi/search/__pycache__/DtkSearchGoodsReq.cpython-36.pyc b/dtkApi/search/__pycache__/DtkSearchGoodsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6a5d9cbc27be25e66e6b39c351024e8f2f4ecd7 Binary files /dev/null and b/dtkApi/search/__pycache__/DtkSearchGoodsReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/JdGoodsReq.cpython-36.pyc b/dtkApi/search/__pycache__/JdGoodsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7eed3dc7d99843c8859e095432c8b48781a57e8e Binary files /dev/null and b/dtkApi/search/__pycache__/JdGoodsReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/ListHotWordsReq.cpython-36.pyc b/dtkApi/search/__pycache__/ListHotWordsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81d65b0886795c9d483b84d5a875d86a7141925b Binary files /dev/null and b/dtkApi/search/__pycache__/ListHotWordsReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/PddGoodsReq.cpython-36.pyc b/dtkApi/search/__pycache__/PddGoodsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27e536e86c8022c8d472acf4d3fbc44b663bf811 Binary files /dev/null and b/dtkApi/search/__pycache__/PddGoodsReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/SuggestionReq.cpython-36.pyc b/dtkApi/search/__pycache__/SuggestionReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b0adf4bec0d84d3e41b70dcc6922f87acfac0ae Binary files /dev/null and b/dtkApi/search/__pycache__/SuggestionReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/SuperGoodsReq.cpython-36.pyc b/dtkApi/search/__pycache__/SuperGoodsReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..13dc81d892dcbe76a35100873dcad0c7c20a2236 Binary files /dev/null and b/dtkApi/search/__pycache__/SuperGoodsReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/TbServiceReq.cpython-36.pyc b/dtkApi/search/__pycache__/TbServiceReq.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62a3179f9bfeb23dd8636610951c1e2cf7005a06 Binary files /dev/null and b/dtkApi/search/__pycache__/TbServiceReq.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/Top100Req.cpython-36.pyc b/dtkApi/search/__pycache__/Top100Req.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d349f7254f32d450673add087932f3676f7028d Binary files /dev/null and b/dtkApi/search/__pycache__/Top100Req.cpython-36.pyc differ diff --git a/dtkApi/search/__pycache__/__init__.cpython-36.pyc b/dtkApi/search/__pycache__/__init__.cpython-36.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e79da6326d0a2474eccf73efa808c9afa624af8 Binary files /dev/null and b/dtkApi/search/__pycache__/__init__.cpython-36.pyc differ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000000000000000000000000000000000000..c0807aa15c70e0948d8a8d0807bb6fb03dc9b762 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +from setuptools import (setup, find_packages) +setup( + # 包名 + name="dtkApi", + # 版本 + version="1.0.1", + # github地址[我学习的样例地址] + url='https://gitee.com/dtk-developer/openapi-sdk-python.git', + # 需要包含的子包列表 + packages=find_packages() +)