webapi.py 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493
  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;jy-test"
  38. }
  39. # 定义第二个 headers
  40. headers_1 = {
  41. "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;jy-test",
  42. "Content-Type":"application/json",
  43. "MiniprogramCode":"wy_zbxm"
  44. }
  45. #headers设置为全局变量
  46. GSTORE['headers'] = headers
  47. GSTORE['headers_1'] = headers_1
  48. # session对象设置为全局变量
  49. s = requests.Session()
  50. GSTORE['s'] = s
  51. #pc登录接口
  52. def mgr_login(self, phone='18211989987', password='#80Z!RVv52',useproxies=False):
  53. headers=GSTORE['headers']
  54. s = GSTORE['s']
  55. if useproxies:
  56. self.s.proxies.update({'http':'127.0.0.1:8888'})
  57. response = self.s.post(f"{cfg.target_host}/phone/login",headers=headers,data=
  58. {
  59. 'reqType': 'phoneLogin',
  60. 'isAutoLogin': 'false',
  61. 'phone':phone,
  62. 'password':password
  63. })
  64. # 把response对象返回出去
  65. return response
  66. #登录后获取session
  67. def get_session(self):
  68. response=self.mgr_login()
  69. # 检查登录是否成功
  70. if response.status_code == 200:
  71. # 通过 response.cookies 获取 session 信息
  72. cookies = response.cookies
  73. session_id = cookies.get('SESSIONID') # 假设 session ID 存储在 cookie 中
  74. print(f"Session ID: {session_id}")
  75. return session_id
  76. else:
  77. print("Login failed!")
  78. return None
  79. # app登录接口
  80. def mgr_login_app(self, phone='18211989987', password='#80Z!RVv52',useproxies=False):
  81. headers=GSTORE['headers']
  82. s = GSTORE['s']
  83. if useproxies:
  84. self.s.proxies.update({'http':'127.0.0.1:8888'})
  85. response = self.s.post(f"{cfg.target_host_app}/jyapp/free/login",headers=headers,params=
  86. {
  87. 'reqType': 'phoneLogin',
  88. 'phone':phone,
  89. 'password':password,
  90. 'rid':'',
  91. 'oid': '',
  92. 'phoneType': '',
  93. 'channel': '',
  94. 'deviceId': ''
  95. })
  96. # 把response对象返回出去
  97. return response
  98. """退出登录pc"""
  99. def mgr_logout(self):
  100. url = f"{cfg.target_host}/front/signOut"
  101. headers = GSTORE['headers']
  102. s = GSTORE['s']
  103. s.post(url=url, headers=headers)
  104. # return res
  105. """退出登录app"""
  106. def mgr_logout_app(self):
  107. url = f"{cfg.target_host_app}/jyapp/free/signOut"
  108. headers = GSTORE['headers']
  109. s = GSTORE['s']
  110. s.post(url=url, headers=headers)
  111. #招标搜索
  112. def bidsearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
  113. #使用全局变量
  114. headers = GSTORE['headers']
  115. 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":""}
  116. #保存session
  117. session = self.s
  118. response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  119. return response
  120. #超前项目搜索
  121. def advanced_search(self):
  122. #使用全局变量
  123. headers = GSTORE['headers']
  124. #保存session
  125. session = self.s
  126. data={
  127. "searchGroup": 2,
  128. "reqType": "lastNews",
  129. "pageNum": 1,
  130. "pageSize": 50,
  131. "keyWords": "科技",
  132. "searchMode": 0,
  133. "bidField": "",
  134. "publishTime": "1689573022-1721195422",
  135. "selectType": "title,content",
  136. "subtype": "",
  137. "exclusionWords": "",
  138. "buyer": "",
  139. "winner": "",
  140. "agency": "",
  141. "industry": "",
  142. "province": "",
  143. "city": "",
  144. "district": "",
  145. "buyerClass": "",
  146. "fileExists": "",
  147. "price": "",
  148. "buyerTel": "",
  149. "winnerTel": ""
  150. }
  151. response = session.post(f"{cfg.target_host}/jyapi/jybx/core/mType/searchList", headers=headers, data=data)
  152. return response
  153. # 企业搜索
  154. def enterpriseSearch(self, match="北京剑鱼信息技术有限公司河南分公司", matchType="A", pageSize="10", pageNum="0"):
  155. # 使用全局变量
  156. headers = GSTORE['headers']
  157. # 保存session
  158. session = self.s
  159. response = session.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery", headers=headers, data={
  160. 'match': match,
  161. 'matchType': matchType,
  162. 'pageSize': pageSize,
  163. 'pageNum': pageNum
  164. })
  165. return response
  166. # 供应搜索
  167. def supplySearch(self, keywords="PH计", searchType="title", province="", city="", time="", status="0",
  168. pageSize=50, pageIndex=1):
  169. headers = GSTORE['headers']
  170. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  171. url = f"{cfg.target_host}/jyinfo/supplySearch"
  172. data = {
  173. "keywords": keywords,
  174. "searchType": searchType,
  175. "province": province,
  176. "city": city,
  177. "time": time,
  178. "status": status,
  179. "pageSize": pageSize,
  180. "pageIndex": pageIndex
  181. }
  182. session=self.s
  183. response = session.post(url=url, headers=headers, data=json.dumps(data))
  184. return response
  185. #采购单位搜索
  186. def buyer_search(self, buyerName, province=None, city=None, buyerClass=None, isCheckFollow=True, isCheckReceive=True,
  187. isContact=0, pageSize=10, pageNum=1):
  188. if buyerClass is None:
  189. buyerClass = []
  190. if city is None:
  191. city = []
  192. if province is None:
  193. province = []
  194. url = f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList"
  195. data = {
  196. "buyerName": buyerName,
  197. "province": province,
  198. "city": city,
  199. "buyerClass": buyerClass,
  200. "isCheckFollow": isCheckFollow,
  201. "isCheckReceive": isCheckReceive,
  202. "isContact": isContact,
  203. "pageSize": pageSize,
  204. "pageNum":pageNum
  205. }
  206. response = requests.post(url=url, json=data, headers=self.headers)
  207. return response
  208. #融创用户搜索
  209. def rc_search(self):
  210. headers = GSTORE['headers']
  211. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  212. url = f"{cfg.target_host}/jyapi/jybx/core/mType/searchList"
  213. params={
  214. "searchGroup": 0,
  215. "reqType": "lastNews",
  216. "pageNum": 1,
  217. "pageSize": 50,
  218. "keyWords": "医疗设备",
  219. "searchMode": 0,
  220. "bidField": "",
  221. "publishTime": "1654704000-1657900799",
  222. "selectType": "title,content",
  223. "subtype": "",
  224. "exclusionWords": "",
  225. "buyer": "",
  226. "winner": "",
  227. "agency": "",
  228. "industry": "",
  229. "province": "",
  230. "city": "",
  231. "district": "",
  232. "buyerClass": "",
  233. "fileExists": "",
  234. "price": "",
  235. "buyerTel": "",
  236. "winnerTel": "",
  237. "mobileTag": [
  238. "军队类",
  239. "武警类",
  240. "融通类",
  241. "退役类",
  242. "融办类",
  243. "某某类",
  244. "all"
  245. ]
  246. }
  247. session = self.s
  248. response = session.post(url=url, headers=headers, params=params)
  249. return response
  250. """三级页公告摘要"""
  251. #两个接口,
  252. def preagent(self,url='https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'):
  253. headers = {
  254. 'Referer': url
  255. }
  256. s = GSTORE["s"]
  257. response = s.get(f"{cfg.target_host}/publicapply/detail/preAgent", headers=headers)
  258. response_data=json.loads(response.text)
  259. token=response_data["data"]["token"]
  260. return token
  261. def detail_baseinfo(self,url='https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'):
  262. headers = GSTORE['headers']
  263. s = GSTORE["s"]
  264. token=self.preagent(url)
  265. params = {
  266. "token":token
  267. }
  268. response = s.post(f"{cfg.target_host}/publicapply/detail/baseInfo", headers=headers, params=params)
  269. return response
  270. """三级页商机推荐"""
  271. def detail_advancedinfo(self):
  272. headers = GSTORE['headers']
  273. s = GSTORE["s"]
  274. res = self.detail_baseinfo()
  275. response_data = json.loads(res.text)
  276. token = response_data["data"]["token"]
  277. params = {
  278. "token": token
  279. }
  280. response = s.post(f"{cfg.target_host}/publicapply/detail/advancedInfo", headers=headers, params=params)
  281. return response
  282. """三级页监控项目"""
  283. def detail_monitor_project(self):
  284. headers = GSTORE['headers']
  285. s = GSTORE["s"]
  286. params = {
  287. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM="
  288. }
  289. response = s.post(f"{cfg.target_host}/bigmember/follow/project/add", headers=headers, params=params)
  290. return response
  291. """取消项目监控"""
  292. def cacel_project(self):
  293. headers = GSTORE['headers']
  294. s = GSTORE["s"]
  295. params = {
  296. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM=",
  297. "fid[followId]":"ABCY3ZdfT0FUCw4AnpUA3k%3D",
  298. "fid[limit_count]": 10,
  299. "fid[msg_open]": True,
  300. "fid[status]": True,
  301. }
  302. response = s.post(f"{cfg.target_host}/bigmember/follow/project/cancel", headers=headers, params=params)
  303. return response
  304. """用户信息获取isadd接口"""
  305. def isadd(self):
  306. headers = GSTORE['headers']
  307. s = GSTORE["s"]
  308. response = s.get(f"{cfg.target_host}/bigmember/use/isAdd", headers=headers)
  309. return response
  310. #接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
  311. #获取推送记录接口
  312. def push_list(self):
  313. headers=GSTORE['headers']
  314. s = GSTORE['s']
  315. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list",headers=headers,json=
  316. {"pageNum": 1, "pageSize": 50, "format": "table", "area": "", "selectTime": "all", "city": "", "buyerClass": "",
  317. "subtype": "", "industry": "", "keyWords": "", "fileExists": "", "price": "", "source": "", "exportNum": "",
  318. "vt": ""})
  319. return response
  320. # 不登录招标搜索
  321. def notloggedin_search(self, keyword='科技', publishtime='thisyear', selectType='content,title'):
  322. headers = GSTORE['headers']
  323. params={"keywords": keyword , "publishtime": publishtime, "timeslot": "", "area": "", "subtype": "",
  324. "minprice": "", "maxprice": "", "industry": "", "buyerclass": "", "buyertel": "", "winnertel": "",
  325. "selectType": selectType, "notkey": "", "fileExists": "0", "city": "", "searchGroup": "0",
  326. "searchMode": "0", "wordsMode": "0", "additionalWords": ""}
  327. response = requests.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  328. response.raise_for_status() # 如果请求失败,会抛出异常
  329. return response
  330. #不登录采购单位搜索
  331. def notloggedin_buysearch(self,keyword):
  332. headers = GSTORE['headers']
  333. s = GSTORE['s']
  334. data = {"buyerName":keyword,"province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  335. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList", headers=headers, json=data)
  336. # response.raise_for_status() # 如果请求失败,会抛出异常
  337. return response
  338. #消息中心列表
  339. def get_messagelist(self):
  340. headers = GSTORE['headers']
  341. s = GSTORE['s']
  342. response=s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=headers,json=
  343. {
  344. "isColumn": True,
  345. "isColumnNewMsg": False,
  346. "isMsgList": True,
  347. "msgType": -1,
  348. "isRead": -1,
  349. "offset": 1,
  350. "size": 20
  351. })
  352. return response
  353. #点击查看消息消息状态修改成已读
  354. def get_markread(self):
  355. hearders = GSTORE['headers']
  356. s = GSTORE['s']
  357. json={
  358. "msgId":285266
  359. }
  360. response = s.post(f"{cfg.target_host}/jyapi/messageCenter/markRead", headers=hearders,json=json)
  361. return response
  362. """用户中台"""
  363. def get_userCenter(self):
  364. hearders = GSTORE['headers']
  365. s = GSTORE['s']
  366. response = s.post(f"{cfg.target_host}/userCenter/workDesktop/menuInfo", headers=hearders)
  367. return response
  368. """我的订单"""
  369. def get_myOrder(self):
  370. hearders = GSTORE['headers']
  371. s = GSTORE['s']
  372. params = {
  373. "type": 0,
  374. "pageNum": 1,
  375. "fromPage": "pc",
  376. "page_size": 10
  377. }
  378. response = s.post(f"{cfg.target_host}/subscribepay/orderListDetails/myOrder", headers=hearders, params=params)
  379. return response
  380. """优惠卷"""
  381. def get_coupon(self):
  382. hearders = GSTORE['headers']
  383. s = GSTORE['s']
  384. params={
  385. "mold": 4,
  386. "currentPage": 1,
  387. "pageSize": 8,
  388. "platform": "P"
  389. }
  390. response= s.post(f"{cfg.target_host}/jyCoupon/getInfoByUser", headers=hearders,params=params)
  391. return response
  392. """数据自动导出"""
  393. def get_dataExport(self,publishtime=1672502400_1688951529,keyword='数据',selectType='title'):
  394. hearders = GSTORE['headers']
  395. s = GSTORE['s']
  396. params={
  397. "publishtime":publishtime,
  398. "area":"",
  399. "city":"",
  400. "region":"",
  401. "industry":"",
  402. "buyerclass":"",
  403. "keyword": [{"keyword":keyword,"appended":[],"exclude":[]}],
  404. "selectType":selectType,
  405. "minprice":"",
  406. "maxprice":"",
  407. "subtype":"",
  408. "buyer":"",
  409. "winner":"",
  410. "dataType": 2
  411. }
  412. response = s.post(f"{cfg.target_host}/front/dataExport/sieveData", headers=hearders, params=params)
  413. return response
  414. """数据导出记录"""
  415. def Export_recordList(self):
  416. hearders = GSTORE['headers']
  417. s = GSTORE['s']
  418. params={
  419. "pageNum": 0,
  420. "pageSize": 10
  421. }
  422. response = s.post(f"{cfg.target_host}/subscribepay/dataExportPack/recordList", headers=hearders, params=params)
  423. return response
  424. """数据导出-超出2w条,点击不在提示"""
  425. def export_prompt(self):
  426. hearders = GSTORE['headers']
  427. s = GSTORE['s']
  428. params={
  429. "status": 1
  430. }
  431. response = s.post(f"{cfg.target_host}/front/dataExport/setDontPromptAgain", headers=hearders, params=params)
  432. return response
  433. """数据导出-判断是否展示弹框"""
  434. def export_frame(self):
  435. hearders = GSTORE['headers']
  436. s = GSTORE['s']
  437. response = s.post(f"{cfg.target_host}/front/dataExport/getDontPromptAgain", headers=hearders)
  438. return response
  439. """数据导出筛选条件列表"""
  440. def export_list(self):
  441. hearders = GSTORE['headers']
  442. s = GSTORE['s']
  443. response = s.get(f"{cfg.target_host}/subscribepay/dataExportPack/screenList", headers=hearders)
  444. return response
  445. """剑鱼文库搜索"""
  446. def Library_search(self,keyWord='数据'):
  447. hearders = GSTORE['headers']
  448. s = GSTORE['s']
  449. params={
  450. "keyWord":keyWord,
  451. "tag":"",
  452. "sort": "tSort",
  453. "num": 1,
  454. "size": 10
  455. }
  456. response = s.post(f"{cfg.target_host}/jydocs/search", headers=hearders, params=params)
  457. return response
  458. """剑鱼文库收藏"""
  459. def Library_collection(self):
  460. hearders = GSTORE['headers']
  461. s = GSTORE['s']
  462. params={
  463. "sign": 1,
  464. "num": 1,
  465. "size": 10
  466. }
  467. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  468. return response
  469. """剑鱼文库我的文库"""
  470. def My_library(self):
  471. hearders = GSTORE['headers']
  472. s = GSTORE['s']
  473. params={
  474. "sign": 0,
  475. "num": 1,
  476. "size": 10
  477. }
  478. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  479. return response
  480. """项目进度监控"""
  481. def Project_monitoring(self):
  482. hearders = GSTORE['headers']
  483. s = GSTORE['s']
  484. params={
  485. "pageNum": 0,
  486. "pageSize": 500
  487. }
  488. response = s.post(f"{cfg.target_host}/bigmember/follow/project/list", headers=hearders, params=params)
  489. return response
  490. """企业情报监控"""
  491. def Enterprise_monitoring(self):
  492. hearders = GSTORE['headers']
  493. s = GSTORE['s']
  494. params={
  495. "pageNum": 0,
  496. "pageSize": 10,
  497. "match":"",
  498. "group":"",
  499. }
  500. response = s.post(f"{cfg.target_host}/bigmember/follow/ent/list", headers=hearders, params=params)
  501. return response
  502. """客户监控"""
  503. def Customer_monitoring(self,):
  504. hearders = GSTORE['headers']
  505. s = GSTORE['s']
  506. params = {
  507. "pagesize": 10,
  508. "pageno": 0,
  509. "keyword":""
  510. }
  511. response = s.post(f"{cfg.target_host}/publicapply/customer/list", headers=hearders, params=params)
  512. return response
  513. """标讯收藏"""
  514. def Message_Collection(self):
  515. hearders = GSTORE['headers']
  516. s = GSTORE['s']
  517. params={
  518. "buyerPhone":0,
  519. "buyerclass":"",
  520. "label":"",
  521. "pagenum":1,
  522. "pagesize":50,
  523. "selectTime":"",
  524. "winnerPhone":0
  525. }
  526. response = s.post(f"{cfg.target_host}/publicapply/bidcoll/list", headers=hearders, params=params)
  527. return response
  528. """标讯收藏"""
  529. #信息获取
  530. def Getuser(self):
  531. headers = GSTORE['headers']
  532. s = GSTORE['s']
  533. response = s.get(f"{cfg.target_host}/jypay/user/getAccountInfo", headers=headers)
  534. return response
  535. #密码校验
  536. def Check_password(self):
  537. headers = GSTORE['headers']
  538. s = GSTORE['s']
  539. params = {
  540. "password": "#80Z!RVv52"
  541. }
  542. response = s.post(f"{cfg.target_host}/publicapply/password/check", headers=headers, params=params)
  543. return response
  544. #身份获取
  545. def Identity_list(self,n=0):
  546. headers = GSTORE['headers']
  547. s = GSTORE['s']
  548. params = {
  549. }
  550. response = s.post(f"{cfg.target_host}/publicapply/identity/list",headers=headers, params=params)
  551. # 解析响应内容为JSON
  552. response_json = response.json()
  553. # 从JSON响应中提取token
  554. self.token = response_json['data'][n]['token']
  555. return response
  556. def Identity_switch(self):
  557. headers = GSTORE['headers']
  558. s = GSTORE["s"]
  559. params = {
  560. "token":self.token
  561. }
  562. response =s.post(f"{cfg.target_host}/publicapply/identity/switch", headers=headers, params=params)
  563. return response
  564. """获取用户信息"""
  565. def User_info(self):
  566. headers = {
  567. 'content-Type': 'application/json',
  568. 'appId': '10000',
  569. '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'
  570. }
  571. s = GSTORE["s"]
  572. params = {}
  573. response =s.post(f"{cfg.target_host}/userCenter/ent/userInfo",headers=headers,params=params)
  574. return response
  575. def Whether_buy(self):
  576. headers = GSTORE["headers"]
  577. s = GSTORE["s"]
  578. response =s.get(f"{cfg.target_host}/entnicheNew/buy/whetherbuy",headers=headers)
  579. return response
  580. def Commonly_List(self):
  581. headers = {
  582. 'content-Type': 'application/json',
  583. 'appId': '10000',
  584. 'userid': '63a41aa5cd7ea10389b2a8f3'
  585. }
  586. s = GSTORE['s']
  587. response =s.post(f"{cfg.target_host}/userCenter/workDesktop/renew/commonlyList",headers=headers)
  588. return response
  589. """权限校验"""
  590. def Authorised_info(self):
  591. headers = {
  592. "Content-Type":"application/json",
  593. "functionCode":"znsj_kf_use"
  594. }
  595. s = GSTORE['s']
  596. response =s.post(f"{cfg.target_host}/resourceCenter/waitEmpowerDetail",headers=headers)
  597. return response
  598. """未登录采购单位列表"""
  599. def nologin_buyer_list(self):
  600. headers = GSTORE['headers']
  601. s = GSTORE['s']
  602. data = {"buyerName":"","province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  603. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList",headers=headers,json=data)
  604. return response
  605. """未登录供应商列表"""
  606. def nologin_supplySearch(self):
  607. headers = GSTORE['headers']
  608. s = GSTORE['s']
  609. data = {"keywords":"信息","searchType":"title","province":"","city":"","time":"","status":"0","pageSize":50,"pageIndex":1}
  610. response =s.post(f"{cfg.target_host}/jyinfo/supplySearch",headers=headers,json=data)
  611. return response
  612. """未登录企业搜索"""
  613. def nologin_enterpriseSearch(self):
  614. headers = GSTORE['headers']
  615. s = GSTORE['s']
  616. params = {"match":"科技"}
  617. response =s.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery",headers=headers, params=params)
  618. return response
  619. """未登录招标信息搜索"""
  620. def nologin_Tender_search(self ):
  621. headers = GSTORE['headers']
  622. s = GSTORE['s']
  623. params = {"match":"科技"}
  624. response =s.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList",headers=headers, params=params)
  625. return response
  626. """未登录拟在建搜索"""
  627. def nologin_Proposed_construction_search(self ):
  628. headers = GSTORE['headers']
  629. s = GSTORE['s']
  630. params = {"match":"科技"}
  631. response =s.post(f"{cfg.target_host}/front/project/nzj/search",headers=headers, params=params)
  632. return response
  633. """未登录拟在建搜索详情页"""
  634. def nologin_proposed_construction_content(self):
  635. headers = GSTORE['headers']
  636. s = GSTORE['s']
  637. params = {"pid":"040600055c0f00594f4351560153085d530f4e4200035201"}
  638. response =s.post(f"{cfg.target_host}/front/project/nzj/details",headers=headers, params=params)
  639. return response
  640. """工作桌面首页行业报告"""
  641. def industry_report(self):
  642. headers = GSTORE['headers']
  643. s = GSTORE['s']
  644. response = s.get(f"{cfg.target_host}/front/project/deskAnalysisReport", headers=headers)
  645. return response
  646. """工作桌面首页商机情报详情页"""
  647. def business_opportunity(self):
  648. headers = GSTORE['headers']
  649. s = GSTORE['s']
  650. # id='ABCY1xaYD0FJD0sNHN6cAcSMTI4DRZjV3diPB43LyEgfGpzbQFUCV8='
  651. response = s.get(f"{cfg.target_host}/bigmember/project/businessDetails?id=ABCY1xaYD0FJD0sNHN6cAcSMTI4DRZjV3diPB43LyEgfGpzbQFUCV8=", headers=headers,data={})
  652. return response
  653. """大会员推送记录列表"""
  654. def bigmember_push(self):
  655. headers = GSTORE['headers']
  656. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  657. {
  658. "pageNum": 1,
  659. "pageSize": 50,
  660. "format": "table",
  661. "area": "",
  662. "selectTime": "all",
  663. "city": "",
  664. "buyerClass": "",
  665. "subtype": "",
  666. "industry": "",
  667. "keyWords": "",
  668. "fileExists": "",
  669. "price": "",
  670. "source": "",
  671. "exportNum": "",
  672. "district": "",
  673. "isRead": "",
  674. "vt": "m"
  675. })
  676. return response
  677. """商机管理推送记录"""
  678. def entniche_push(self):
  679. headers = GSTORE['headers']
  680. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  681. {
  682. "pageNum": 1,
  683. "pageSize": 50,
  684. "format": "table",
  685. "area": "",
  686. "selectTime": "all",
  687. "city": "",
  688. "buyerClass": "",
  689. "subtype": "",
  690. "industry": "",
  691. "keyWords": "",
  692. "fileExists": "",
  693. "price": "",
  694. "source": "",
  695. "exportNum": "",
  696. "district": "",
  697. "isRead": "",
  698. "vt": "s"
  699. })
  700. return response
  701. """订阅搜索"""
  702. #免费用户订阅搜索
  703. def free_subscription_search(self):
  704. headers = GSTORE['headers']
  705. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list", headers=headers, json=
  706. {
  707. "pageNum": 1,
  708. "pageSize": 50,
  709. "format": "table",
  710. "area": "",
  711. "selectTime": "1718534447_1721126447",
  712. "city": "",
  713. "buyerClass": "",
  714. "subtype": "",
  715. "industry": "",
  716. "keyWords": "",
  717. "fileExists": "",
  718. "price": "",
  719. "source": "",
  720. "exportNum": "",
  721. "district": "",
  722. "isRead": "",
  723. "vt": ""
  724. })
  725. return response
  726. #超级订阅用户订阅搜索
  727. def svip_subscription_search(self):
  728. headers = GSTORE['headers']
  729. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/vType/list", headers=headers, json=
  730. {
  731. "pageNum": 1,
  732. "pageSize": 50,
  733. "format": "table",
  734. "area": "安徽",
  735. "selectTime": "1675094400_1719763199",
  736. "city": "",
  737. "buyerClass": "传媒,采矿业,电信行业,金融业,建筑业,能源化工,农林牧渔,批发零售,信息技术,运输物流,制造业,住宿餐饮",
  738. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更",
  739. "industry": "",
  740. "keyWords": "计算机",
  741. "fileExists": "",
  742. "price": "",
  743. "source": "",
  744. "exportNum": "",
  745. "district": "",
  746. "isRead": "",
  747. "vt": "v"
  748. })
  749. return response
  750. #大会员用户订阅搜索
  751. def bigmember_subscription_search(self):
  752. headers = GSTORE['headers']
  753. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  754. {
  755. "pageNum": 1,
  756. "pageSize": 50,
  757. "format": "table",
  758. "area": "安徽,北京,甘肃",
  759. "selectTime": "1672502400_1719763199",
  760. "city": "",
  761. "buyerClass": "人大,政协,党委办,组织,宣传,统战,纪委,政府办,发改,财政,教育,科技,工信,民政,民宗,人社,公安,检察院,法院,司法,应急管理,军队,自然资源,生态环境,住建,市政,城管,交通,水利,农业,气象,文旅,卫健委,医疗,学校,档案,体育,政务中心,机关事务,国资委,海关,税务,市场监管,商务,人行,银保监,证监,审计,出版广电,统计,公共资源交易,社会团体",
  762. "subtype": "招标预告,预告,预审,预审结果,论证意见,需求公示,招标结果,中标,成交,废标,流标",
  763. "industry": "",
  764. "keyWords": "信息,科技,能源",
  765. "fileExists": "",
  766. "price": "",
  767. "source": "",
  768. "exportNum": "",
  769. "isRead": "1",
  770. "vt": "m"
  771. })
  772. return response
  773. #新增项目关注
  774. def new_project_attention(self):
  775. headers = GSTORE['headers']
  776. response =self.s.post(f"{cfg.target_host}/bigmember/follow/project/add?sid=ABCY1xaYD0vLD86RHxkcwcvJDAZDSB3dlVkKDgzIDodeGpzfQlUCdA=",headers=headers)
  777. return response
  778. #关注项目地区筛选
  779. def project_screenarea(self):
  780. headers = GSTORE['headers']
  781. response =self.s.get(f"{cfg.target_host}/bigmember/follow/project/screenArea",headers=headers, params={})
  782. return response
  783. #商机管理订阅搜索
  784. def entname_subscription_search(self):
  785. headers = GSTORE['headers']
  786. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  787. {
  788. "pageNum": 1,
  789. "pageSize": 50,
  790. "format": "table",
  791. "area": "安徽,重庆,河南,江苏",
  792. "selectTime": "1672502400_1719763199",
  793. "city": "",
  794. "buyerClass": "",
  795. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更,招标结果,中标,成交,废标,流标",
  796. "industry": "农林牧渔_生产物资,农林牧渔_生产设备,农林牧渔_相关服务",
  797. "keyWords": "农业,园林,森林",
  798. "fileExists": "",
  799. "price": "",
  800. "source": "1",
  801. "exportNum": "",
  802. "isRead": "",
  803. "vt": "s"
  804. })
  805. return response
  806. #招标采购搜索信息对外接口
  807. def bid_search_api(self):
  808. headers = {
  809. 'Accept-Charset': 'utf-8',
  810. 'timestamp': '1726207205',
  811. 'sign': '1058A958B8D562EA9F2234AC42716778',
  812. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  813. 'Content-Type': 'application/json'
  814. }
  815. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/search?appid=jianyuDev", headers=headers, json={
  816. "releaseTimeStart": 1695456870,"keyWord": ["市政粮食"],"searchMode":1})
  817. return response
  818. #招标采购搜索信息普通字段包对外接口
  819. def bid_ordinarypkg(self):
  820. headers = {
  821. 'Accept-Charset': 'utf-8',
  822. 'timestamp': '1726207205',
  823. 'sign': '1058A958B8D562EA9F2234AC42716778',
  824. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  825. 'Content-Type': 'application/json'
  826. }
  827. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/ordinarypkg?appid=jianyuDev",
  828. headers=headers, json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
  829. return response
  830. # 招标采购搜索信息高级字段包对外接口
  831. def bid_seniorpkg(self):
  832. headers = {
  833. 'Accept-Charset': 'utf-8',
  834. 'timestamp': '1726207205',
  835. 'sign': '1058A958B8D562EA9F2234AC42716778',
  836. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  837. 'Content-Type': 'application/json'
  838. }
  839. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/seniorpkg?appid=jianyuDev",
  840. headers=headers,
  841. json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
  842. return response
  843. #招标采购信息附件下载接口
  844. def bid_annex(self):
  845. headers = {
  846. 'Accept-Charset': 'utf-8',
  847. 'timestamp': '1726207205',
  848. 'sign': '1058A958B8D562EA9F2234AC42716778',
  849. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  850. 'Content-Type': 'application/json'
  851. }
  852. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/annex?appid=jianyuDev",
  853. headers=headers,
  854. json={"fid":"040507510f0a075618137614500208530c095c500f1814785d44030451"})
  855. return response
  856. #客户标签类型获取
  857. def customer_getLabel(self):
  858. headers = GSTORE['headers']
  859. response = self.s.post(f"{cfg.target_host}/entnicheNew/customer/getLabel", headers=headers, json={})
  860. return response
  861. #商机管理客户关注
  862. def customer_attention(self):
  863. headers = GSTORE['headers']
  864. response = self.s.post(f"{cfg.target_host}/publicapply/customer/attention", headers=headers, json={"name":"石嘴山市交通工程建设管理中心","mold":1,"D":True})
  865. return response
  866. #app登录后获取新用户留资报表
  867. def new_uer_sales(self):
  868. headers = GSTORE['headers']
  869. response = self.s.post(f"{cfg.target_host_app}/salesLeads/appIsNewUerSales", headers=headers, json={})
  870. return response
  871. #定制化分析报告_超前项目
  872. def reports_advanced_projects(self):
  873. headers = GSTORE['headers']
  874. response = self.s.post(f"{cfg.target_host}/leadGeneration/getDate", headers=headers, json={})
  875. return response
  876. #行为采集
  877. def behavior_acquisition(self):
  878. headers = GSTORE['headers']
  879. response = self.s.post(f"{cfg.target_host}/leadGeneration/clickRecord", headers=headers, json={"type":"B"})
  880. return response
  881. #获取样例报告信息
  882. def sample_report_information(self):
  883. headers = GSTORE['headers']
  884. response = self.s.post(f"{cfg.target_host}/salesLeads/sampleReport", headers=headers, json={})
  885. return response
  886. #项目名称联想
  887. def project_name_lenovo(self):
  888. headers = GSTORE['headers']
  889. params = {"pName":[ "科技信息"]}
  890. response = self.s.post(f"{cfg.target_host}/bigmember/analysis/projectName", headers=headers, params=params)
  891. return response
  892. #采购单位名称联想
  893. def buyer_name_lenovo(self):
  894. headers = GSTORE['headers']
  895. params = {
  896. "pName":[ "科技信息"],
  897. "sType":1
  898. }
  899. response = self.s.post(f"{cfg.target_host}/bigmember/analysis/projectName", headers=headers, params=params)
  900. return response
  901. #投标决策分析内容
  902. def bidding_decision_analysis_content(self):
  903. headers = GSTORE['headers']
  904. json = {
  905. "area": {"北京": []},
  906. "buyer": "北京大学",
  907. "buyerContent": [
  908. {
  909. "key": ["设备"],
  910. "matchway": 1
  911. },
  912. {
  913. "key": ["多功能投影仪"],
  914. "matchway": 1
  915. }],
  916. "pname": "",
  917. "limitTime": "fiveYear",
  918. "searchItem": 1,
  919. "searchType": 0,
  920. "page": 1,
  921. "pageSize": 5
  922. }
  923. response = self.s.post(f"{cfg.target_host}/bigmember/decision/decInfo", headers=headers, json=json)
  924. return response
  925. #app新用户报表提交/跳过
  926. def app_new_uer_sales(self):
  927. headers = GSTORE['headers']
  928. json = {
  929. "area##business":"广州,北京",
  930. "company":"剑鱼",
  931. "department":"其他",
  932. "model##business":"投标方",
  933. "position":"职员",
  934. "product##engineering":"交通设施,外工程",
  935. "product##product":"化工用品包装材料,机电设备",
  936. "product##seryice":"广告传媒,餐饮服务"
  937. }
  938. response = self.s.post(f"{cfg.target_host_app}/salesLeads/appNewUerSales", headers=headers, json=json)
  939. return response
  940. # 商机情报详情页
  941. def business_intelligence(self):
  942. headers = GSTORE['headers'] = GSTORE['headers']
  943. response = self.s.post(
  944. f"{cfg.target_host}/bigmember/project/businessDetails?id=ABCY1xZdSlYKD0sAnd6cAcSMTI4DRZjV3diPB40OS8NfGpzZQFUCYI%3D",
  945. headers=headers)
  946. return response
  947. def me_Monitoring(self):
  948. headers = GSTORE['headers']
  949. response = self.s.get(f"{cfg.target_host}/bigmember/project/meMonitoring", headers=headers)
  950. return response
  951. # 要闻
  952. def important_News(self):
  953. heards = GSTORE['headers']
  954. response = self.s.get(f"{cfg.target_host}/front/project/importantNews", headers=heards)
  955. return response
  956. # 文库分类
  957. def jydocs_indexTag(self):
  958. headers = GSTORE['headers']
  959. response = self.s.post(f"{cfg.target_host}/jydocs/indexTag", headers=headers, json={})
  960. return response
  961. # 文库搜索
  962. def jydocs_search(self):
  963. headers = GSTORE["headers"]
  964. response = self.s.post(f"{cfg.target_host}/jydocs/search?keyWord=法律", headers=headers)
  965. return response
  966. # 文库详情
  967. def jydocs_detail(self):
  968. headers = GSTORE['headers']
  969. response = self.s.post(f"{cfg.target_host}/jydocs/detail?docId=docin-4756450426", headers=headers)
  970. return response
  971. # 留资提交2.0
  972. def salesLeads_collectInfo(self):
  973. headers = GSTORE['headers']
  974. response = self.s.post(f"{cfg.target_host}/salesLeads/collectInfo", headers=headers,
  975. json={"source": "article_proposed_project", "name": "质量部测试", "phone": "18211989987",
  976. "mail": "1550987547@qq.com", "industry": "", "company": "质量部测试企业",
  977. "companyType": "投标企业", "position": "总裁", "workScope": "", "partnerNeeds": "",
  978. "agree": True, "branch": ""})
  979. return response
  980. # 留资提交
  981. def salesLeads_retainedCapital(self):
  982. headers = GSTORE['headers']
  983. response = self.s.post(f"{cfg.target_host}/salesLeads/retainedCapital", headers=headers,
  984. params={"source": "article_proposed_project"})
  985. return response
  986. #供应信息附件下载
  987. def supplyInfo_attachment(self):
  988. headers = GSTORE['headers']
  989. response = self.s.post(f"{cfg.target_host}/publicapply/attachment/supplyInfo?msgId=RV9AWV1F&fileName=%E7%8E%8B%E7%BF%94%E5%90%8D%E7%89%87.png", headers=headers,)
  990. return response
  991. #采购联系人
  992. def buyer_contact(self):
  993. header = GSTORE['headers']
  994. response = self.s.post(f"{cfg.target_host}/bigmember/search/buyer/association?name=河南科技大学", headers=header)
  995. return response
  996. #消息查看记录
  997. def msgopenlog(self):
  998. header = GSTORE['headers']
  999. data={
  1000. "msgLogId":287204,
  1001. "platform":1}
  1002. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/msgOpenLog",headers=header,json=data)
  1003. return response
  1004. #查看消息详情
  1005. def messagedetail(self):
  1006. header = GSTORE['headers']
  1007. data={
  1008. "msgLogId":240818
  1009. }
  1010. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/messageDetail",headers=header,json=data)
  1011. return response
  1012. #拟在建搜索条件接口
  1013. def conditions(self):
  1014. header = GSTORE['headers']
  1015. response = self.s.post(f"{cfg.target_host}/front/project/nzj/conditions",headers=header)
  1016. return response
  1017. # 工作桌面商机情报列表
  1018. def workdesk_intelligence(self):
  1019. header = GSTORE['headers']
  1020. data = {
  1021. "msgType": 5,
  1022. "needDealtWithCount": True,
  1023. "offset": 1,
  1024. "size": 5
  1025. }
  1026. response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/WorkDeskList", headers=header, json=data)
  1027. return response
  1028. #商品积分查询
  1029. def goods_points(self):
  1030. header = GSTORE['headers']
  1031. response = self.s.post(f"{cfg.target_host}/jyintegral/productPoints/introduction",headers=header)
  1032. return response
  1033. #工作桌面首页-我的消息-未读消息数量
  1034. def workdesk_unread_messages(self):
  1035. header = GSTORE['headers']
  1036. json ={
  1037. "size": 20,
  1038. "msgType": -1,
  1039. "offset": 1,
  1040. "isRead": 0,
  1041. "isColumn": False,
  1042. "isColumnNewMsg": False,
  1043. "isContainLetter": False,
  1044. "isMsgList": False
  1045. }
  1046. response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=header,json=json)
  1047. return response
  1048. #一键清空未读消息
  1049. def clear_unread_msg(self):
  1050. header = GSTORE['headers']
  1051. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/ClearUnreadMsg",headers = header)
  1052. return response
  1053. #新商机管理-企业订阅-修改关键词设置
  1054. def update_keyword_entnichenew(self):
  1055. header = GSTORE['headers']
  1056. json = {
  1057. "a_items": [
  1058. {
  1059. "a_key": [
  1060. {
  1061. "key": [
  1062. "计算机"
  1063. ],
  1064. "notkey": [],
  1065. "matchway": 1
  1066. }
  1067. ],
  1068. "groupIndex": 0,
  1069. "opened": True,
  1070. "s_item": "测试分组",
  1071. "showForm": False,
  1072. "updatetime": 0
  1073. }
  1074. ],
  1075. "identity": "ent"
  1076. }
  1077. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/update", headers=header,json=json)
  1078. return response
  1079. #获取区域设置
  1080. def entnichenew_area(self):
  1081. headers = GSTORE['headers']
  1082. s = GSTORE['s']
  1083. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get",headers = headers)
  1084. return response
  1085. #商机管理-企业订阅-获取关键词设置
  1086. def keywords_get(self):
  1087. headers = GSTORE['headers']
  1088. data ={
  1089. "identity": "ent"
  1090. }
  1091. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/get", headers=headers, data =data)
  1092. return response
  1093. #商机管理-企业订阅-获取推送设置
  1094. def pushset_get(self):
  1095. headers = GSTORE['headers']
  1096. data={
  1097. "identity": "ent"
  1098. }
  1099. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/get", headers=headers, data=data)
  1100. return response
  1101. #设置登录保持期
  1102. def set_keeplogin(self):
  1103. headers = GSTORE['headers']
  1104. data = {
  1105. "isAutoLogin" : "true" ,
  1106. "loginER" : "NSg7BAFFBQMHBkZXRFpXRAsDBQJHBzwN___NjcAJDRFBQMHBkZXRFpXRAsDBQJHGTE8"
  1107. }
  1108. response = self.s.post(f"{cfg.target_host}/free/setKeepLogin",headers = headers ,data = data)
  1109. return response
  1110. #发送邮箱验证码
  1111. def send_mailverify(self):
  1112. headers = GSTORE["headers"]
  1113. data = {
  1114. "email" : "luwenna@topnet.net.cn"
  1115. }
  1116. response = self.s.post(f"{cfg.target_host}/front/dataExport/sendMailVerify",headers = headers , data = data)
  1117. return response
  1118. #验证数据导出邮箱验证码
  1119. def check_mailverify(self):
  1120. headers = GSTORE["headers"]
  1121. data = {
  1122. "emailVerity" : "YQ09Z1",
  1123. "email" : "luwenna@topnet.net.cn"
  1124. }
  1125. response = self.s.post(f"{cfg.target_host}/front/dataExport/checkMailVerify", headers = headers ,data = data)
  1126. return response
  1127. #数据导出筛选预览数据
  1128. def preview_sievedata(self):
  1129. headers = GSTORE["headers"]
  1130. data = {
  1131. "publishtime": "1566214955 _1660909355",
  1132. "area": "北京",
  1133. "city": "成都市",
  1134. "region": "成都市,北京",
  1135. "industry": "建筑工程_勘察设计, 建筑工程_工程施工, 建筑工程_监理咨询, 建筑工程_材料设备, 建筑工程_机电安装",
  1136. "buyerclass": "党委办, 财政",
  1137. "keyword": [{
  1138. "keyword": "软件",
  1139. "appended": [],
  1140. "exclude": []
  1141. }],
  1142. "selectType": "filetext, title, detail, title",
  1143. "minprice": "0.1",
  1144. "maxprice": "1000000",
  1145. "subtype": "中标, 成交, 废标, 流标"
  1146. }
  1147. response =self.s.post(f"{cfg.target_host}/front/dataExport/sieveData",headers = headers ,data =data)
  1148. return response
  1149. # 修改采购单位类型设置
  1150. def entnichenew_buyesclass_update(self):
  1151. headers = GSTORE['headers']
  1152. s = GSTORE['s']
  1153. json = {
  1154. "buyer": [
  1155. "法院",
  1156. "发改"
  1157. ],
  1158. "identity": "ent"
  1159. }
  1160. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get", headers=headers,json=json)
  1161. return response
  1162. # 获取信息类型
  1163. def entnichenew_infotype(self):
  1164. headers = GSTORE['headers']
  1165. s = GSTORE['s']
  1166. json = {
  1167. "identity": "ent"
  1168. }
  1169. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/index", headers=headers,json=json)
  1170. return response
  1171. # 修改信息类型
  1172. def entnichenew_infotype_update(self):
  1173. headers = GSTORE['headers']
  1174. s = GSTORE['s']
  1175. json = {
  1176. "msg": [
  1177. "预告",
  1178. "预审",
  1179. "预审结果",
  1180. "论证意见",
  1181. "需求公示"
  1182. ],
  1183. "identity": "ent"
  1184. }
  1185. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/infotype/update", headers=headers,json=json)
  1186. return response
  1187. #商机管理-企业订阅-修改推送设置
  1188. def entnichenew_pushset_update(self):
  1189. headers = GSTORE['headers']
  1190. data = {
  1191. "ratemode": 2,
  1192. "apppush": 1,
  1193. "mailpush": 1,
  1194. "matchway": 2,
  1195. "wxpush": 1,
  1196. "matchmode": "title,detail",
  1197. "switch": 1,
  1198. "identity": "ent"
  1199. }
  1200. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/update", headers=headers,data=data)
  1201. return response
  1202. #未登录“拟在建项目”详情页
  1203. def nzj_details(self):
  1204. headers = GSTORE['headers']
  1205. params = {
  1206. "pid":"040709005b58070d4a46020952075350590c1d4302530802"
  1207. }
  1208. response = self.s.get(f"{cfg.target_host}/front/project/nzj/details", headers=headers,params=params)
  1209. return response
  1210. #获取小程序广告位
  1211. def debrisproduct_getAdList(self):
  1212. headers_1 = GSTORE['headers_1']
  1213. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAdList", headers=headers_1,data={"Code":"jy-appsearch-home-top"})
  1214. return response
  1215. #获取地理位置
  1216. def debrisproduct_getLocation(self):
  1217. headers_1 = GSTORE['headers_1']
  1218. response = self.s.get(f"{cfg.target_host_wxapi}/debrisproduct/free/location", headers=headers_1)
  1219. return response
  1220. #所有商机获取
  1221. def debrisproduct_getAllBusiness(self):
  1222. headers_1 = GSTORE['headers_1']
  1223. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAllBusiness", headers=headers_1)
  1224. return response
  1225. #获取小程序配置
  1226. def debrisproduct_getConfig(self):
  1227. headers_1 = GSTORE['headers_1']
  1228. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getSetting", headers=headers_1)
  1229. return response
  1230. #业主单位名称联想
  1231. def debrisproduct_getAssName(self):
  1232. headers_1 = GSTORE['headers_1']
  1233. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getAssName", headers=headers_1,data={"buyerName":"科技"})
  1234. return response
  1235. #业主单位列表
  1236. def debrisproduct_getList(self):
  1237. headers_1 = GSTORE['headers_1']
  1238. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getList", headers=headers_1,data={"page_num":10,"pagesize":1})
  1239. return response
  1240. #业主搜索历史
  1241. def debrisproduct_buyer_getSearchList(self):
  1242. headers_1 = GSTORE['headers_1']
  1243. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getSearchList", headers=headers_1)
  1244. return response
  1245. #获取价格列表
  1246. def debrisproduct_getPriceList(self):
  1247. headers_1 = GSTORE['headers_1']
  1248. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/getPriceList", headers=headers_1)
  1249. return response
  1250. """子部门"""
  1251. def subdepartment(self):
  1252. hearders = GSTORE['headers']
  1253. s = GSTORE['s']
  1254. data = {
  1255. "id":26741
  1256. }
  1257. response = s.post(f"{cfg.target_host}/entbase/department/childrens", headers=hearders, data=data)
  1258. return response
  1259. """添加人员"""
  1260. def add_personnel(self):
  1261. hearders = GSTORE['headers']
  1262. s = GSTORE['s']
  1263. data = {
  1264. "name":"贾路瑶",
  1265. "phone":"19588533063",
  1266. "id":26741
  1267. }
  1268. response = s.post(f"{cfg.target_host}/entbase/person/add", headers=hearders, data=data)
  1269. return response
  1270. """企业信息"""
  1271. def enterprise_information(self):
  1272. hearders = GSTORE['headers']
  1273. s = GSTORE['s']
  1274. params= {
  1275. "t":"1736561573400"
  1276. }
  1277. response = s.get(f"{cfg.target_host}/entbase/ent/entinfo", headers=hearders, params=params)
  1278. return response
  1279. """分发设置列表接口"""
  1280. def distribution_list(self):
  1281. hearders = GSTORE['headers']
  1282. s = GSTORE['s']
  1283. data= {
  1284. "identity":"ent"
  1285. }
  1286. response = s.get(f"{cfg.target_host}/entnicheNew/distribute/list", headers=hearders, data=data)
  1287. return response
  1288. """分发规则修改接口"""
  1289. def distribution_update(self):
  1290. hearders = GSTORE['headers']
  1291. s = GSTORE['s']
  1292. json= {
  1293. "id": "67820b98e7364a57c3b7eaf5",
  1294. "buyerclass": ["财政"],
  1295. "items": ["测试分组"],
  1296. "persons": [96208],
  1297. "area": {"安徽": []},
  1298. "district": {},
  1299. "identity": "ent"
  1300. }
  1301. response = s.get(f"{cfg.target_host}/entnicheNew/distribute/update", headers=hearders, json=json)
  1302. return response
  1303. """分发规则详情接口"""
  1304. def distribution_details(self):
  1305. hearders = GSTORE['headers']
  1306. s = GSTORE['s']
  1307. data= {
  1308. "identity": "ent"
  1309. }
  1310. response = s.get(f"{cfg.target_host_app}/entnicheNew/distribute/detail?id=67820b98e7364a57c3b7eaf5", headers=hearders, data=data)
  1311. return response
  1312. """采购单位画像数据"""
  1313. def prchasing_profile_data(self):
  1314. hearders = GSTORE['headers']
  1315. s = GSTORE['s']
  1316. params= {
  1317. "buyer":"黎明化工研究设计院有限责任公司",
  1318. "exactMatch":0
  1319. }
  1320. response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getData", headers=hearders, params=params)
  1321. return response
  1322. """最新项目动态"""
  1323. def latest_project_news(self):
  1324. hearders = GSTORE['headers']
  1325. s = GSTORE['s']
  1326. params= {
  1327. "buyer":"黎明化工研究设计院有限责任公司",
  1328. "PageNum":1,
  1329. "pageSize":5
  1330. }
  1331. response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getNewMsg", headers=hearders, params=params)
  1332. return response
  1333. #是否登录
  1334. def hassign(self):
  1335. header = GSTORE['headers']
  1336. response = self.s.post(f"{cfg.target_host}/front/hasSign",headers=header)
  1337. return response
  1338. #电销
  1339. #个人信息查询
  1340. def personal_info(self):
  1341. header = GSTORE['headers']
  1342. session=self.get_session()
  1343. json = {
  1344. "sid":session
  1345. }
  1346. response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo", headers=header,json=json)
  1347. return response
  1348. #搜索结果数据导出
  1349. def searchexport(self):
  1350. hearders = GSTORE['headers']
  1351. data ={
  1352. "searchvalue":"软件",
  1353. "selectIds":"ABCY1xWZC4%2FMD8vM3dzc1w4PiRfTBZmYUFkKD8jJiEgaGdzYFJUCnA%3D"
  1354. }
  1355. response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
  1356. return response
  1357. #已购产品列表
  1358. def buy_productlist(self):
  1359. hearders = GSTORE['headers']
  1360. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/buyProductList", headers=hearders)
  1361. return response
  1362. #使用人员列表
  1363. def usepersonlist(self):
  1364. hearders = GSTORE['headers']
  1365. json = {
  1366. "wait_empower_id": 31142
  1367. }
  1368. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/usePersonList", headers=hearders , json= json)
  1369. return response
  1370. #医械通我认领的经销商
  1371. def distributor(self):
  1372. header = GSTORE['headers']
  1373. response = self.s.post(f"{cfg.target_host}/jyapi/domain/claim/distributor",headers=header)
  1374. return response
  1375. #医械通获取用户认证信息
  1376. def userauthInfo(self):
  1377. header = GSTORE['headers']
  1378. response = self.s.post(f"{cfg.target_host}/jyapi/domain/userAuthInfo",headers=header)
  1379. return response
  1380. #pc/微信招标采购搜索-数据导出
  1381. def pc_wx_searchExport(self):
  1382. headers =GSTORE['headers']
  1383. params = {
  1384. "searchvalue": "科技",
  1385. "additionalWords": "软件",
  1386. "searchGroup": "0",
  1387. "searchMode": "0",
  1388. "wordsMode": "0"
  1389. }
  1390. response =self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport",headers = headers ,params =params)
  1391. return response
  1392. # pc/微信招标采购搜索-数据导出
  1393. def app_searchExport(self):
  1394. headers = GSTORE['headers']
  1395. params = {
  1396. "searchvalue": "科技",
  1397. "additionalWords": "软件",
  1398. "searchGroup": "0",
  1399. "searchMode": "0",
  1400. "wordsMode": "0"
  1401. }
  1402. response = self.s.post(f"{cfg.target_host}/jyapp/front/dataExport/searchExport", headers=headers, params=params)
  1403. return response
  1404. apimgr = APIMgr()