webapi.py 53 KB

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