webapi.py 53 KB

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