webapi.py 58 KB

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