|
@@ -172,6 +172,108 @@ class APIMgr():
|
|
|
response = requests.post(url=url, json=data, headers=self.headers)
|
|
|
self.printResponse(response)
|
|
|
return response
|
|
|
+
|
|
|
+ #融创用户搜索
|
|
|
+ def rc_search(self):
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ headers['Content-Type'] = 'application/json' # 添加Content-Type头部
|
|
|
+ url = f"{cfg.target_host}/jyapi/jybx/core/mType/searchList"
|
|
|
+ params={
|
|
|
+ "searchGroup": 0,
|
|
|
+ "reqType": "lastNews",
|
|
|
+ "pageNum": 1,
|
|
|
+ "pageSize": 50,
|
|
|
+ "keyWords": "医疗设备",
|
|
|
+ "searchMode": 0,
|
|
|
+ "bidField": "",
|
|
|
+ "publishTime": "1654704000-1657900799",
|
|
|
+ "selectType": "title,content",
|
|
|
+ "subtype": "",
|
|
|
+ "exclusionWords": "",
|
|
|
+ "buyer": "",
|
|
|
+ "winner": "",
|
|
|
+ "agency": "",
|
|
|
+ "industry": "",
|
|
|
+ "province": "",
|
|
|
+ "city": "",
|
|
|
+ "district": "",
|
|
|
+ "buyerClass": "",
|
|
|
+ "fileExists": "",
|
|
|
+ "price": "",
|
|
|
+ "buyerTel": "",
|
|
|
+ "winnerTel": "",
|
|
|
+ "mobileTag": [
|
|
|
+ "军队类",
|
|
|
+ "武警类",
|
|
|
+ "融通类",
|
|
|
+ "退役类",
|
|
|
+ "融办类",
|
|
|
+ "某某类",
|
|
|
+ "all"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+
|
|
|
+ session = self.s
|
|
|
+ response = session.post(url=url, headers=headers, params=params)
|
|
|
+ self.printResponse(response)
|
|
|
+ return response
|
|
|
+
|
|
|
+ """三级页公告摘要"""
|
|
|
+ #两个接口,
|
|
|
+ def preagent(self):
|
|
|
+ headers = {
|
|
|
+ 'Referer': 'https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'
|
|
|
+ }
|
|
|
+ s = GSTORE["s"]
|
|
|
+ response = s.get(f"{cfg.target_host}/publicapply/detail/preAgent", headers=headers)
|
|
|
+ response_data=json.loads(response.text)
|
|
|
+ token=response_data["data"]["token"]
|
|
|
+ return token
|
|
|
+
|
|
|
+ def detail_baseinfo(self):
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ s = GSTORE["s"]
|
|
|
+ token=self.preagent()
|
|
|
+ params = {
|
|
|
+ "token":token
|
|
|
+ }
|
|
|
+ response = s.post(f"{cfg.target_host}/publicapply/detail/baseInfo", headers=headers, params=params)
|
|
|
+ return response
|
|
|
+ """三级页商机推荐"""
|
|
|
+ def detail_advancedinfo(self):
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ s = GSTORE["s"]
|
|
|
+ res = self.detail_baseinfo()
|
|
|
+ response_data = json.loads(res.text)
|
|
|
+ token = response_data["data"]["token"]
|
|
|
+ params = {
|
|
|
+ "token": token
|
|
|
+ }
|
|
|
+ response = s.post(f"{cfg.target_host}/publicapply/detail/advancedInfo", headers=headers, params=params)
|
|
|
+ return response
|
|
|
+ """三级页监控项目"""
|
|
|
+ def detail_monitor_project(self):
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ s = GSTORE["s"]
|
|
|
+ params = {
|
|
|
+ "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM="
|
|
|
+ }
|
|
|
+ response = s.post(f"{cfg.target_host}/bigmember/follow/project/add", headers=headers, params=params)
|
|
|
+ return response
|
|
|
+ """取消项目监控"""
|
|
|
+ def cacel_project(self):
|
|
|
+ headers = GSTORE['headers']
|
|
|
+ s = GSTORE["s"]
|
|
|
+ params = {
|
|
|
+ "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM=",
|
|
|
+ "fid[followId]":"ABCY3ZdfT0FUCw4AnpUA3k%3D",
|
|
|
+ "fid[limit_count]": 10,
|
|
|
+ "fid[msg_open]": True,
|
|
|
+ "fid[status]": True,
|
|
|
+ }
|
|
|
+ response = s.post(f"{cfg.target_host}/bigmember/follow/project/cancel", headers=headers, params=params)
|
|
|
+ return response
|
|
|
+
|
|
|
#接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
|
|
|
#获取推送记录接口
|
|
|
def push_list(self):
|
|
@@ -384,7 +486,7 @@ class APIMgr():
|
|
|
response = s.post(f"{cfg.target_host}/publicapply/password/check", headers=headers, params=params)
|
|
|
return response
|
|
|
#身份获取
|
|
|
- def Identity_list(self):
|
|
|
+ def Identity_list(self,n=0):
|
|
|
headers = GSTORE['headers']
|
|
|
s = GSTORE['s']
|
|
|
params = {
|
|
@@ -393,15 +495,16 @@ class APIMgr():
|
|
|
# 解析响应内容为JSON
|
|
|
response_json = response.json()
|
|
|
# 从JSON响应中提取token
|
|
|
- self.token = response_json['data'][0]['token']
|
|
|
+ self.token = response_json['data'][n]['token']
|
|
|
return response
|
|
|
+
|
|
|
def Identity_switch(self):
|
|
|
- headers = GSTORE["headers"]
|
|
|
+ headers = GSTORE['headers']
|
|
|
s = GSTORE["s"]
|
|
|
params = {
|
|
|
"token":self.token
|
|
|
- }
|
|
|
- response =s.post(f"{cfg.target_host}/publicapply/identity/switch", headers=self.headers,params=params)
|
|
|
+ }
|
|
|
+ response =s.post(f"{cfg.target_host}/publicapply/identity/switch", headers=headers, params=params)
|
|
|
return response
|
|
|
"""获取用户信息"""
|
|
|
def User_info(self):
|
|
@@ -414,6 +517,7 @@ class APIMgr():
|
|
|
params = {}
|
|
|
response =s.post(f"{cfg.target_host}/userCenter/ent/userInfo",headers=headers,params=params)
|
|
|
return response
|
|
|
+
|
|
|
def Whether_buy(self):
|
|
|
headers = GSTORE["headers"]
|
|
|
s = GSTORE["s"]
|