webapi.py 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. import json
  2. import requests
  3. from hytest.common import *
  4. from cfg import cfg
  5. from bs4 import BeautifulSoup
  6. from requests.packages import urllib3
  7. #存放公用方法
  8. # 存储 全局共享 数据
  9. GSTORE = {}
  10. class APIMgr():
  11. #打印https请求与消息
  12. def __init__(self):
  13. self.ui = None
  14. self.token = None
  15. def printRequest(self,req):
  16. if req.body==None:
  17. msgBody=''
  18. else:
  19. msgBody=req.body
  20. self.ui.outputWindow.append(
  21. '{}\n{}\n{}\n\n{}'.format(
  22. '\n\n-------发送请求--------',
  23. req.method+''+req.url,
  24. '\n'.join('{}:{}'.format(k,v) for k,v in req.headers.items()),
  25. msgBody,
  26. ))
  27. # 打印http相应消息的函数
  28. def printResponse(self, response):
  29. print('\n\n----- https response begin -----')
  30. print(response.status_code)
  31. # print(response.headers)
  32. for k, v in response.headers.items():
  33. print(f'{k}:{v}')
  34. print(response.content.decode('utf8'))
  35. print('----- https response end-----\n\n')
  36. headers = {
  37. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67"
  38. }
  39. #headers设置为全局变量
  40. GSTORE['headers'] = headers
  41. # session对象设置为全局变量
  42. s = requests.Session()
  43. GSTORE['s'] = s
  44. #pc登录接口
  45. def mgr_login(self, phone='18211989987', password='123456',useproxies=False):
  46. headers=GSTORE['headers']
  47. s = GSTORE['s']
  48. if useproxies:
  49. self.s.proxies.update({'http':'127.0.0.1:8888'})
  50. response = self.s.post(f"{cfg.target_host}/phone/login",headers=headers,data=
  51. {
  52. 'reqType': 'phoneLogin',
  53. 'isAutoLogin': 'false',
  54. 'phone':phone,
  55. 'password':password
  56. })
  57. self.printResponse(response)
  58. # 把response对象返回出去
  59. return response
  60. # app登录接口
  61. def mgr_login_app(self, phone='18211989987', password='123456',useproxies=False):
  62. headers=GSTORE['headers']
  63. s = GSTORE['s']
  64. if useproxies:
  65. self.s.proxies.update({'http':'127.0.0.1:8888'})
  66. response = self.s.post(f"{cfg.target_host_app}/jyapp/free/login",headers=headers,params=
  67. {
  68. 'reqType': 'phoneLogin',
  69. 'phone':phone,
  70. 'password':password,
  71. 'rid':'',
  72. 'oid': '',
  73. 'phoneType': '',
  74. 'channel': '',
  75. 'deviceId': ''
  76. })
  77. self.printResponse(response)
  78. # 把response对象返回出去
  79. return response
  80. """退出登录pc"""
  81. def mgr_logout(self):
  82. url = f"{cfg.target_host}/front/signOut"
  83. headers = GSTORE['headers']
  84. s = GSTORE['s']
  85. s.post(url=url, headers=headers)
  86. # self.printResponse(res)
  87. # return res
  88. """退出登录app"""
  89. def mgr_logout_app(self):
  90. url = f"{cfg.target_host_app}/jyapp/free/signOut"
  91. headers = GSTORE['headers']
  92. s = GSTORE['s']
  93. s.post(url=url, headers=headers)
  94. #招标搜索
  95. def bidsearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
  96. #使用全局变量
  97. headers = GSTORE['headers']
  98. params={"keywords":keywords,"publishtime":publishtime,"timeslot":"","area":"","subtype":"","minprice":"","maxprice":"","industry":"","buyerclass":"","buyertel":"","winnertel":"","selectType":selectType,"notkey":"","fileExists":"0","city":"","searchGroup":"0","searchMode":"0","wordsMode":"0","additionalWords":""}
  99. #保存session
  100. session = self.s
  101. response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  102. self.printResponse(response)
  103. return response
  104. #超前项目搜索
  105. def advanced_search(self):
  106. #使用全局变量
  107. headers = GSTORE['headers']
  108. #保存session
  109. session = self.s
  110. data={
  111. "searchGroup": 2,
  112. "reqType": "lastNews",
  113. "pageNum": 1,
  114. "pageSize": 50,
  115. "keyWords": "",
  116. "searchMode": 0,
  117. "bidField": "",
  118. "publishTime": "1689573022-1721195422",
  119. "selectType": "title,content",
  120. "subtype": "",
  121. "exclusionWords": "",
  122. "buyer": "",
  123. "winner": "",
  124. "agency": "",
  125. "industry": "",
  126. "province": "",
  127. "city": "",
  128. "district": "",
  129. "buyerClass": "",
  130. "fileExists": "",
  131. "price": "",
  132. "buyerTel": "",
  133. "winnerTel": ""
  134. }
  135. response = session.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList", headers=headers, json=data)
  136. return response
  137. # 企业搜索
  138. def enterpriseSearch(self, match="北京剑鱼信息技术有限公司河南分公司", matchType="A", pageSize="10", pageNum="0"):
  139. # 使用全局变量
  140. headers = GSTORE['headers']
  141. # 保存session
  142. session = self.s
  143. response = session.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery", headers=headers, data={
  144. 'match': match,
  145. 'matchType': matchType,
  146. 'pageSize': pageSize,
  147. 'pageNum': pageNum
  148. })
  149. self.printResponse(response)
  150. return response
  151. # 供应搜索
  152. def supplySearch(self, keywords="PH计", searchType="title", province="", city="", time="", status="0",
  153. pageSize=50, pageIndex=1):
  154. headers = GSTORE['headers']
  155. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  156. url = f"{cfg.target_host}/jyinfo/supplySearch"
  157. data = {
  158. "keywords": keywords,
  159. "searchType": searchType,
  160. "province": province,
  161. "city": city,
  162. "time": time,
  163. "status": status,
  164. "pageSize": pageSize,
  165. "pageIndex": pageIndex
  166. }
  167. session=self.s
  168. response = session.post(url=url, headers=headers, data=json.dumps(data))
  169. self.printResponse(response)
  170. return response
  171. #采购单位搜索
  172. def buyer_search(self, buyerName, province=None, city=None, buyerClass=None, isCheckFollow=True, isCheckReceive=True,
  173. isContact=0, pageSize=10, pageNum=1):
  174. if buyerClass is None:
  175. buyerClass = []
  176. if city is None:
  177. city = []
  178. if province is None:
  179. province = []
  180. url = f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList"
  181. data = {
  182. "buyerName": buyerName,
  183. "province": province,
  184. "city": city,
  185. "buyerClass": buyerClass,
  186. "isCheckFollow": isCheckFollow,
  187. "isCheckReceive": isCheckReceive,
  188. "isContact": isContact,
  189. "pageSize": pageSize,
  190. "pageNum":pageNum
  191. }
  192. response = requests.post(url=url, json=data, headers=self.headers)
  193. self.printResponse(response)
  194. return response
  195. #融创用户搜索
  196. def rc_search(self):
  197. headers = GSTORE['headers']
  198. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  199. url = f"{cfg.target_host}/jyapi/jybx/core/mType/searchList"
  200. params={
  201. "searchGroup": 0,
  202. "reqType": "lastNews",
  203. "pageNum": 1,
  204. "pageSize": 50,
  205. "keyWords": "医疗设备",
  206. "searchMode": 0,
  207. "bidField": "",
  208. "publishTime": "1654704000-1657900799",
  209. "selectType": "title,content",
  210. "subtype": "",
  211. "exclusionWords": "",
  212. "buyer": "",
  213. "winner": "",
  214. "agency": "",
  215. "industry": "",
  216. "province": "",
  217. "city": "",
  218. "district": "",
  219. "buyerClass": "",
  220. "fileExists": "",
  221. "price": "",
  222. "buyerTel": "",
  223. "winnerTel": "",
  224. "mobileTag": [
  225. "军队类",
  226. "武警类",
  227. "融通类",
  228. "退役类",
  229. "融办类",
  230. "某某类",
  231. "all"
  232. ]
  233. }
  234. session = self.s
  235. response = session.post(url=url, headers=headers, params=params)
  236. self.printResponse(response)
  237. return response
  238. """三级页公告摘要"""
  239. #两个接口,
  240. def preagent(self):
  241. headers = {
  242. 'Referer': 'https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'
  243. }
  244. s = GSTORE["s"]
  245. response = s.get(f"{cfg.target_host}/publicapply/detail/preAgent", headers=headers)
  246. response_data=json.loads(response.text)
  247. token=response_data["data"]["token"]
  248. return token
  249. def detail_baseinfo(self):
  250. headers = GSTORE['headers']
  251. s = GSTORE["s"]
  252. token=self.preagent()
  253. params = {
  254. "token":token
  255. }
  256. response = s.post(f"{cfg.target_host}/publicapply/detail/baseInfo", headers=headers, params=params)
  257. return response
  258. """三级页商机推荐"""
  259. def detail_advancedinfo(self):
  260. headers = GSTORE['headers']
  261. s = GSTORE["s"]
  262. res = self.detail_baseinfo()
  263. response_data = json.loads(res.text)
  264. token = response_data["data"]["token"]
  265. params = {
  266. "token": token
  267. }
  268. response = s.post(f"{cfg.target_host}/publicapply/detail/advancedInfo", headers=headers, params=params)
  269. return response
  270. """三级页监控项目"""
  271. def detail_monitor_project(self):
  272. headers = GSTORE['headers']
  273. s = GSTORE["s"]
  274. params = {
  275. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM="
  276. }
  277. response = s.post(f"{cfg.target_host}/bigmember/follow/project/add", headers=headers, params=params)
  278. return response
  279. """取消项目监控"""
  280. def cacel_project(self):
  281. headers = GSTORE['headers']
  282. s = GSTORE["s"]
  283. params = {
  284. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM=",
  285. "fid[followId]":"ABCY3ZdfT0FUCw4AnpUA3k%3D",
  286. "fid[limit_count]": 10,
  287. "fid[msg_open]": True,
  288. "fid[status]": True,
  289. }
  290. response = s.post(f"{cfg.target_host}/bigmember/follow/project/cancel", headers=headers, params=params)
  291. return response
  292. """用户信息获取isadd接口"""
  293. def isadd(self):
  294. headers = GSTORE['headers']
  295. s = GSTORE["s"]
  296. response = s.get(f"{cfg.target_host}/bigmember/use/isAdd", headers=headers)
  297. return response
  298. #接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
  299. #获取推送记录接口
  300. def push_list(self):
  301. headers=GSTORE['headers']
  302. s = GSTORE['s']
  303. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list",headers=headers,json=
  304. {"pageNum": 1, "pageSize": 50, "format": "table", "area": "", "selectTime": "all", "city": "", "buyerClass": "",
  305. "subtype": "", "industry": "", "keyWords": "", "fileExists": "", "price": "", "source": "", "exportNum": "",
  306. "vt": ""})
  307. return response
  308. # 不登录招标搜索
  309. def notloggedin_search(self, keyword='科技', publishtime='thisyear', selectType='content,title'):
  310. headers = GSTORE['headers']
  311. params={"keywords": keyword , "publishtime": publishtime, "timeslot": "", "area": "", "subtype": "",
  312. "minprice": "", "maxprice": "", "industry": "", "buyerclass": "", "buyertel": "", "winnertel": "",
  313. "selectType": selectType, "notkey": "", "fileExists": "0", "city": "", "searchGroup": "0",
  314. "searchMode": "0", "wordsMode": "0", "additionalWords": ""}
  315. response = requests.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  316. response.raise_for_status() # 如果请求失败,会抛出异常
  317. return response
  318. #不登录采购单位搜索
  319. def notloggedin_buysearch(self,keyword):
  320. headers = GSTORE['headers']
  321. s = GSTORE['s']
  322. data = {"buyerName":keyword,"province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  323. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList", headers=headers, json=data)
  324. # response.raise_for_status() # 如果请求失败,会抛出异常
  325. return response
  326. #消息中心列表
  327. def get_messagelist(self):
  328. headers = GSTORE['headers']
  329. s = GSTORE['s']
  330. response=s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=headers,json=
  331. {"msgType":-1,"isRead":-1,"offset":1,"size":20})
  332. return response
  333. """用户中台"""
  334. def get_userCenter(self):
  335. hearders = GSTORE['headers']
  336. s = GSTORE['s']
  337. response = s.post(f"{cfg.target_host}/userCenter/workDesktop/menuInfo", headers=hearders)
  338. return response
  339. """我的订单"""
  340. def get_myOrder(self):
  341. hearders = GSTORE['headers']
  342. s = GSTORE['s']
  343. params = {
  344. "type": 0,
  345. "pageNum": 1,
  346. "fromPage": "pc",
  347. "page_size": 10
  348. }
  349. response = s.post(f"{cfg.target_host}/subscribepay/orderListDetails/myOrder", headers=hearders, params=params)
  350. return response
  351. """优惠卷"""
  352. def get_coupon(self):
  353. hearders = GSTORE['headers']
  354. s = GSTORE['s']
  355. params={
  356. "mold": 4,
  357. "currentPage": 1,
  358. "pageSize": 8,
  359. "platform": "P"
  360. }
  361. response= s.post(f"{cfg.target_host}/jyCoupon/getInfoByUser", headers=hearders,params=params)
  362. return response
  363. """数据自动导出"""
  364. def get_dataExport(self,publishtime=1672502400_1688951529,keyword='数据',selectType='title'):
  365. hearders = GSTORE['headers']
  366. s = GSTORE['s']
  367. params={
  368. "publishtime":publishtime,
  369. "area":"",
  370. "city":"",
  371. "region":"",
  372. "industry":"",
  373. "buyerclass":"",
  374. "keyword": [{"keyword":keyword,"appended":[],"exclude":[]}],
  375. "selectType":selectType,
  376. "minprice":"",
  377. "maxprice":"",
  378. "subtype":"",
  379. "buyer":"",
  380. "winner":"",
  381. "dataType": 2
  382. }
  383. response = s.post(f"{cfg.target_host}/front/dataExport/sieveData", headers=hearders, params=params)
  384. return response
  385. """数据导出记录"""
  386. def Export_recordList(self):
  387. hearders = GSTORE['headers']
  388. s = GSTORE['s']
  389. params={
  390. "pageNum": 0,
  391. "pageSize": 10
  392. }
  393. response = s.post(f"{cfg.target_host}/subscribepay/dataExportPack/recordList", headers=hearders, params=params)
  394. return response
  395. """剑鱼文库搜索"""
  396. def Library_search(self,keyWord='数据'):
  397. hearders = GSTORE['headers']
  398. s = GSTORE['s']
  399. params={
  400. "keyWord":keyWord,
  401. "tag":"",
  402. "sort": "tSort",
  403. "num": 1,
  404. "size": 10
  405. }
  406. response = s.post(f"{cfg.target_host}/jydocs/search", headers=hearders, params=params)
  407. return response
  408. """剑鱼文库收藏"""
  409. def Library_collection(self):
  410. hearders = GSTORE['headers']
  411. s = GSTORE['s']
  412. params={
  413. "sign": 1,
  414. "num": 1,
  415. "size": 10
  416. }
  417. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  418. return response
  419. """剑鱼文库我的文库"""
  420. def My_library(self):
  421. hearders = GSTORE['headers']
  422. s = GSTORE['s']
  423. params={
  424. "sign": 0,
  425. "num": 1,
  426. "size": 10
  427. }
  428. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  429. return response
  430. """项目进度监控"""
  431. def Project_monitoring(self):
  432. hearders = GSTORE['headers']
  433. s = GSTORE['s']
  434. params={
  435. "pageNum": 0,
  436. "pageSize": 500
  437. }
  438. response = s.post(f"{cfg.target_host}/bigmember/follow/project/list", headers=hearders, params=params)
  439. return response
  440. """企业情报监控"""
  441. def Enterprise_monitoring(self):
  442. hearders = GSTORE['headers']
  443. s = GSTORE['s']
  444. params={
  445. "pageNum": 0,
  446. "pageSize": 10,
  447. "match":"",
  448. "group":"",
  449. }
  450. response = s.post(f"{cfg.target_host}/bigmember/follow/ent/list", headers=hearders, params=params)
  451. return response
  452. """客户监控"""
  453. def Customer_monitoring(self,):
  454. hearders = GSTORE['headers']
  455. s = GSTORE['s']
  456. params = {
  457. "pagesize": 10,
  458. "pageno": 0,
  459. "keyword":""
  460. }
  461. response = s.post(f"{cfg.target_host}/publicapply/customer/list", headers=hearders, params=params)
  462. return response
  463. """标讯收藏"""
  464. def Message_Collection(self):
  465. hearders = GSTORE['headers']
  466. s = GSTORE['s']
  467. params={
  468. "buyerPhone":0,
  469. "buyerclass":"",
  470. "label":"",
  471. "pagenum":1,
  472. "pagesize":50,
  473. "selectTime":"",
  474. "winnerPhone":0
  475. }
  476. response = s.post(f"{cfg.target_host}/publicapply/bidcoll/list", headers=hearders, params=params)
  477. return response
  478. """标讯收藏"""
  479. #信息获取
  480. def Getuser(self):
  481. headers = GSTORE['headers']
  482. s = GSTORE['s']
  483. response = s.get(f"{cfg.target_host}/jypay/user/getAccountInfo", headers=headers)
  484. return response
  485. #密码校验
  486. def Check_password(self):
  487. headers = GSTORE['headers']
  488. s = GSTORE['s']
  489. params = {
  490. "password": "123456"
  491. }
  492. response = s.post(f"{cfg.target_host}/publicapply/password/check", headers=headers, params=params)
  493. return response
  494. #身份获取
  495. def Identity_list(self,n=0):
  496. headers = GSTORE['headers']
  497. s = GSTORE['s']
  498. params = {
  499. }
  500. response = s.post(f"{cfg.target_host}/publicapply/identity/list",headers=headers, params=params)
  501. # 解析响应内容为JSON
  502. response_json = response.json()
  503. # 从JSON响应中提取token
  504. self.token = response_json['data'][n]['token']
  505. return response
  506. def Identity_switch(self):
  507. headers = GSTORE['headers']
  508. s = GSTORE["s"]
  509. params = {
  510. "token":self.token
  511. }
  512. response =s.post(f"{cfg.target_host}/publicapply/identity/switch", headers=headers, params=params)
  513. return response
  514. """获取用户信息"""
  515. def User_info(self):
  516. headers = {
  517. 'content-Type': 'application/json',
  518. 'appId': '10000',
  519. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67'
  520. }
  521. s = GSTORE["s"]
  522. params = {}
  523. response =s.post(f"{cfg.target_host}/userCenter/ent/userInfo",headers=headers,params=params)
  524. return response
  525. def Whether_buy(self):
  526. headers = GSTORE["headers"]
  527. s = GSTORE["s"]
  528. response =s.get(f"{cfg.target_host}/entnicheNew/buy/whetherbuy",headers=headers)
  529. return response
  530. def Commonly_List(self):
  531. headers = {
  532. 'content-Type': 'application/json',
  533. 'appId': '10000',
  534. 'userid': '63a41aa5cd7ea10389b2a8f3'
  535. }
  536. s = GSTORE['s']
  537. response =s.post(f"{cfg.target_host}/userCenter/workDesktop/renew/commonlyList",headers=headers)
  538. return response
  539. """权限校验"""
  540. def Authorised_info(self):
  541. headers = {
  542. "Content-Type":"application/json",
  543. "functionCode":"znsj_kf_use"
  544. }
  545. s = GSTORE['s']
  546. response =s.post(f"{cfg.target_host}/resourceCenter/waitEmpowerDetail",headers=headers)
  547. return response
  548. """未登录采购单位列表"""
  549. def nologin_buyer_list(self):
  550. headers = GSTORE['headers']
  551. s = GSTORE['s']
  552. data = {"buyerName":"","province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  553. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList",headers=headers,json=data)
  554. return response
  555. """未登录供应商列表"""
  556. def nologin_supplySearch(self):
  557. headers = GSTORE['headers']
  558. s = GSTORE['s']
  559. data = {"keywords":"信息","searchType":"title","province":"","city":"","time":"","status":"0","pageSize":50,"pageIndex":1}
  560. response =s.post(f"{cfg.target_host}/jyinfo/supplySearch",headers=headers,json=data)
  561. return response
  562. """未登录企业搜索"""
  563. def nologin_enterpriseSearch(self):
  564. headers = GSTORE['headers']
  565. s = GSTORE['s']
  566. params = {"match":"科技"}
  567. response =s.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery",headers=headers, params=params)
  568. return response
  569. """未登录招标信息搜索"""
  570. def nologin_Tender_search(self ):
  571. headers = GSTORE['headers']
  572. s = GSTORE['s']
  573. params = {"match":"科技"}
  574. response =s.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList",headers=headers, params=params)
  575. return response
  576. """未登录拟在建搜索"""
  577. def nologin_Proposed_construction_search(self ):
  578. headers = GSTORE['headers']
  579. s = GSTORE['s']
  580. params = {"match":"科技"}
  581. response =s.post(f"{cfg.target_host}/front/project/nzj/search",headers=headers, params=params)
  582. return response
  583. """大会员推送记录列表"""
  584. def bigmember_push(self):
  585. headers = GSTORE['headers']
  586. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  587. {
  588. "pageNum": 1,
  589. "pageSize": 50,
  590. "format": "table",
  591. "area": "",
  592. "selectTime": "all",
  593. "city": "",
  594. "buyerClass": "",
  595. "subtype": "",
  596. "industry": "",
  597. "keyWords": "",
  598. "fileExists": "",
  599. "price": "",
  600. "source": "",
  601. "exportNum": "",
  602. "district": "",
  603. "isRead": "",
  604. "vt": "m"
  605. })
  606. return response
  607. """商机管理推送记录"""
  608. def entniche_push(self):
  609. headers = GSTORE['headers']
  610. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  611. {
  612. "pageNum": 1,
  613. "pageSize": 50,
  614. "format": "table",
  615. "area": "",
  616. "selectTime": "all",
  617. "city": "",
  618. "buyerClass": "",
  619. "subtype": "",
  620. "industry": "",
  621. "keyWords": "",
  622. "fileExists": "",
  623. "price": "",
  624. "source": "",
  625. "exportNum": "",
  626. "district": "",
  627. "isRead": "",
  628. "vt": "s"
  629. })
  630. return response
  631. """订阅搜索"""
  632. #免费用户订阅搜索
  633. def free_subscription_search(self):
  634. headers = GSTORE['headers']
  635. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list", headers=headers, json=
  636. {
  637. "pageNum": 1,
  638. "pageSize": 50,
  639. "format": "table",
  640. "area": "",
  641. "selectTime": "1718534447_1721126447",
  642. "city": "",
  643. "buyerClass": "",
  644. "subtype": "",
  645. "industry": "",
  646. "keyWords": "",
  647. "fileExists": "",
  648. "price": "",
  649. "source": "",
  650. "exportNum": "",
  651. "district": "",
  652. "isRead": "",
  653. "vt": ""
  654. })
  655. return response
  656. #超级订阅用户订阅搜索
  657. def svip_subscription_search(self):
  658. headers = GSTORE['headers']
  659. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/vType/list", headers=headers, json=
  660. {
  661. "pageNum": 1,
  662. "pageSize": 50,
  663. "format": "table",
  664. "area": "安徽",
  665. "selectTime": "1675094400_1719763199",
  666. "city": "",
  667. "buyerClass": "传媒,采矿业,电信行业,金融业,建筑业,能源化工,农林牧渔,批发零售,信息技术,运输物流,制造业,住宿餐饮",
  668. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更",
  669. "industry": "",
  670. "keyWords": "计算机",
  671. "fileExists": "",
  672. "price": "",
  673. "source": "",
  674. "exportNum": "",
  675. "district": "",
  676. "isRead": "",
  677. "vt": "v"
  678. })
  679. return response
  680. #大会员用户订阅搜索
  681. def bigmember_subscription_search(self):
  682. headers = GSTORE['headers']
  683. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  684. {
  685. "pageNum": 1,
  686. "pageSize": 50,
  687. "format": "table",
  688. "area": "安徽,北京,甘肃",
  689. "selectTime": "1672502400_1719763199",
  690. "city": "",
  691. "buyerClass": "人大,政协,党委办,组织,宣传,统战,纪委,政府办,发改,财政,教育,科技,工信,民政,民宗,人社,公安,检察院,法院,司法,应急管理,军队,自然资源,生态环境,住建,市政,城管,交通,水利,农业,气象,文旅,卫健委,医疗,学校,档案,体育,政务中心,机关事务,国资委,海关,税务,市场监管,商务,人行,银保监,证监,审计,出版广电,统计,公共资源交易,社会团体",
  692. "subtype": "招标预告,预告,预审,预审结果,论证意见,需求公示,招标结果,中标,成交,废标,流标",
  693. "industry": "",
  694. "keyWords": "信息,科技,能源",
  695. "fileExists": "",
  696. "price": "",
  697. "source": "",
  698. "exportNum": "",
  699. "isRead": "1",
  700. "vt": "m"
  701. })
  702. return response
  703. #商机管理订阅搜索
  704. def entname_subscription_search(self):
  705. headers = GSTORE['headers']
  706. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  707. {
  708. "pageNum": 1,
  709. "pageSize": 50,
  710. "format": "table",
  711. "area": "安徽,重庆,河南,江苏",
  712. "selectTime": "1672502400_1719763199",
  713. "city": "",
  714. "buyerClass": "",
  715. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更,招标结果,中标,成交,废标,流标",
  716. "industry": "农林牧渔_生产物资,农林牧渔_生产设备,农林牧渔_相关服务",
  717. "keyWords": "农业,园林,森林",
  718. "fileExists": "",
  719. "price": "",
  720. "source": "1",
  721. "exportNum": "",
  722. "isRead": "",
  723. "vt": "s"
  724. })
  725. return response
  726. apimgr = APIMgr()