webapi.py 52 KB

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