main-fan-file-download.postman_collection.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. {
  2. "info": {
  3. "_postman_id": "bed94f6b-a870-4530-8f66-d6794e6f3c3f",
  4. "name": "文件下载接口(主通风机报告资料采集)",
  5. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
  6. "description": "按当前项目 extensions/main_fan/crawler_reports.py 的实际调用整理,共 5 个接口。\n\n导入:在 Eolink 的数据导入入口选择 Postman 格式,选择此 JSON 文件。请求参数、JSON 请求体和示例响应均已写入;示例响应仅展示客户端依赖的字段,不代表线上实测结果或完整返回结构。\n\n调用顺序:01 查询矿井 → 填写同一行的 mine_name/dept_id → 02 同步资料类型 → 03 查询资料类型 → 填写 file_name_id → 04 发起采集 → 填写 task_id → 05 查询任务进度。\n\n本文件包含集合变量。若 Eolink 未自动导入集合变量,请按各请求描述在项目环境中创建同名变量,或把 {{变量名}} 替换为实际值。mine_name、dept_id、file_name_id、task_id 留空,须按前序响应填写,不能直接发送带空变量的后续请求。year、file_name_id 必须为整数,dry_run 必须为 true/false,JSON 请求体中这三个变量不带引号。\n\nbase_url 默认 http://10.244.3.155:19010;如果服务仅监听服务器回环,只能在该服务器使用 http://127.0.0.1:19010 或经已有的网络转发访问。此地址属于资料采集服务,不加 /api 前缀,也不使用 VentAgent 的 8080 端口。当前客户端未发送认证头,因此集合使用 No Auth;若实际部署增加认证,请按服务方约定配置。\n\n采集完成后文件由资料采集服务保存至 /home/chief/source_data/{mine_name}/{year}/{report_type}/。VentAgent 从只读挂载目录 /data/source_data/ 复制 PDF。当前接入代码未定义直接返回文件流的 HTTP 下载接口;不要将 /crawl/{task_id} 当作 PDF 下载地址。目录内可能含同年度往期资料,文件月份和归属需核对原文。\n\n此文件仅整理请求,未调用真实采集服务。"
  7. },
  8. "variable": [
  9. {
  10. "key": "base_url",
  11. "value": "http://10.244.3.155:19010",
  12. "type": "string",
  13. "description": "资料采集服务地址,不带末尾斜杠;同机回环部署可改为 http://127.0.0.1:19010。"
  14. },
  15. {
  16. "key": "mine_name",
  17. "value": "",
  18. "type": "string",
  19. "description": "先调用查询矿井接口,从 data.mines 复制目标矿井全称,与 dept_id 必须来自同一行。"
  20. },
  21. {
  22. "key": "dept_id",
  23. "value": "",
  24. "type": "string",
  25. "description": "先调用查询矿井接口,从目标矿井行复制 dept_id,按字符串填写。"
  26. },
  27. {
  28. "key": "year",
  29. "value": "2026",
  30. "type": "string",
  31. "description": "资料年份,四位整数;必须与 period 的年份一致。"
  32. },
  33. {
  34. "key": "period",
  35. "value": "2026-10",
  36. "type": "string",
  37. "description": "采集月份,格式 YYYY-MM;示例值请按实际需要修改。"
  38. },
  39. {
  40. "key": "doc_type_keyword",
  41. "value": "通风机",
  42. "type": "string",
  43. "description": "查询资料类型时的名称筛选词。"
  44. },
  45. {
  46. "key": "report_type",
  47. "value": "通风机性能测定报告",
  48. "type": "string",
  49. "description": "需要的资料类型全称,用于在 data.items 中核对 level3。"
  50. },
  51. {
  52. "key": "file_name_id",
  53. "value": "",
  54. "type": "string",
  55. "description": "从资料类型查询响应中,复制 level3 等于 report_type 的唯一一行的 file_name_id;填整数,不带引号。"
  56. },
  57. {
  58. "key": "task_id",
  59. "value": "",
  60. "type": "string",
  61. "description": "从发起采集响应的 data.task_id 复制,供查询任务进度使用。"
  62. },
  63. {
  64. "key": "dry_run",
  65. "value": "false",
  66. "type": "string",
  67. "description": "false 表示实际采集;作为 JSON 布尔值使用,不带引号。"
  68. }
  69. ],
  70. "auth": {
  71. "type": "noauth"
  72. },
  73. "item": [
  74. {
  75. "name": "01 查询矿井列表",
  76. "request": {
  77. "method": "GET",
  78. "header": [
  79. {
  80. "key": "Accept",
  81. "value": "application/json",
  82. "type": "text"
  83. }
  84. ],
  85. "url": {
  86. "raw": "{{base_url}}/mines?with_tree=0",
  87. "host": [
  88. "{{base_url}}"
  89. ],
  90. "path": [
  91. "mines"
  92. ],
  93. "query": [
  94. {
  95. "key": "with_tree",
  96. "value": "0",
  97. "description": "按当前客户端传 0。"
  98. }
  99. ]
  100. },
  101. "description": "第一步。返回 data.mines 数组。选定目标矿井,将同一行的 mine_name(全称)与 dept_id 写入环境变量,后续请求必须使用这对值。当前调用只依赖 data.mines,不依赖部门树字段。",
  102. "auth": {
  103. "type": "noauth"
  104. }
  105. },
  106. "response": [
  107. {
  108. "name": "响应结构示意(非实测,字段以实际服务为准)",
  109. "originalRequest": {
  110. "method": "GET",
  111. "header": [
  112. {
  113. "key": "Accept",
  114. "value": "application/json",
  115. "type": "text"
  116. }
  117. ],
  118. "url": {
  119. "raw": "{{base_url}}/mines?with_tree=0",
  120. "host": [
  121. "{{base_url}}"
  122. ],
  123. "path": [
  124. "mines"
  125. ],
  126. "query": [
  127. {
  128. "key": "with_tree",
  129. "value": "0",
  130. "description": "按当前客户端传 0。"
  131. }
  132. ]
  133. },
  134. "description": "第一步。返回 data.mines 数组。选定目标矿井,将同一行的 mine_name(全称)与 dept_id 写入环境变量,后续请求必须使用这对值。当前调用只依赖 data.mines,不依赖部门树字段。",
  135. "auth": {
  136. "type": "noauth"
  137. }
  138. },
  139. "status": "OK",
  140. "code": 200,
  141. "_postman_previewlanguage": "json",
  142. "header": [
  143. {
  144. "key": "Content-Type",
  145. "value": "application/json"
  146. }
  147. ],
  148. "cookie": [],
  149. "body": "{\n \"data\": {\n \"mines\": [\n {\n \"mine_name\": \"<实际矿井全称>\",\n \"dept_id\": \"<实际部门编号>\"\n }\n ]\n }\n}"
  150. }
  151. ]
  152. },
  153. {
  154. "name": "02 同步目标矿井资料类型",
  155. "request": {
  156. "method": "POST",
  157. "header": [
  158. {
  159. "key": "Accept",
  160. "value": "application/json",
  161. "type": "text"
  162. },
  163. {
  164. "key": "Content-Type",
  165. "value": "application/json",
  166. "type": "text"
  167. }
  168. ],
  169. "url": {
  170. "raw": "{{base_url}}/doc-types/sync",
  171. "host": [
  172. "{{base_url}}"
  173. ],
  174. "path": [
  175. "doc-types",
  176. "sync"
  177. ]
  178. },
  179. "description": "先填写 mine_name、dept_id、year。请求体为 JSON;year 为整数,dept_id 为字符串。用于同步本矿本年度的资料类型,成功后再查询资料类型列表。HTTP 409 表示同步仍在运行,稍后重试;不能当作同步完成。",
  180. "auth": {
  181. "type": "noauth"
  182. },
  183. "body": {
  184. "mode": "raw",
  185. "raw": "{\n \"mine_name\": \"{{mine_name}}\",\n \"dept_id\": \"{{dept_id}}\",\n \"year\": {{year}}\n}",
  186. "options": {
  187. "raw": {
  188. "language": "json"
  189. }
  190. }
  191. }
  192. },
  193. "response": []
  194. },
  195. {
  196. "name": "03 查询报告资料类型",
  197. "request": {
  198. "method": "GET",
  199. "header": [
  200. {
  201. "key": "Accept",
  202. "value": "application/json",
  203. "type": "text"
  204. }
  205. ],
  206. "url": {
  207. "raw": "{{base_url}}/doc-types?mine={{mine_name}}&year={{year}}&name={{doc_type_keyword}}",
  208. "host": [
  209. "{{base_url}}"
  210. ],
  211. "path": [
  212. "doc-types"
  213. ],
  214. "query": [
  215. {
  216. "key": "mine",
  217. "value": "{{mine_name}}",
  218. "description": "与第一步同一行的矿井全称。"
  219. },
  220. {
  221. "key": "year",
  222. "value": "{{year}}",
  223. "description": "四位年份,与 period 一致。"
  224. },
  225. {
  226. "key": "name",
  227. "value": "{{doc_type_keyword}}",
  228. "description": "名称筛选词,默认通风机。"
  229. }
  230. ]
  231. },
  232. "description": "mine 为矿井全称,不是 dept_id。year 与后续采集月份一致,name 为资料类型名称筛选词(默认通风机)。从 data.items 中查找 level3 与 {{report_type}} 完全相等的唯一一行,把该行 file_name_id 填入同名变量。类型编号按矿井和年份动态查询,不沿用其他矿的示例编号。",
  233. "auth": {
  234. "type": "noauth"
  235. }
  236. },
  237. "response": [
  238. {
  239. "name": "响应结构示意(非实测,字段以实际服务为准)",
  240. "originalRequest": {
  241. "method": "GET",
  242. "header": [
  243. {
  244. "key": "Accept",
  245. "value": "application/json",
  246. "type": "text"
  247. }
  248. ],
  249. "url": {
  250. "raw": "{{base_url}}/doc-types?mine={{mine_name}}&year={{year}}&name={{doc_type_keyword}}",
  251. "host": [
  252. "{{base_url}}"
  253. ],
  254. "path": [
  255. "doc-types"
  256. ],
  257. "query": [
  258. {
  259. "key": "mine",
  260. "value": "{{mine_name}}",
  261. "description": "与第一步同一行的矿井全称。"
  262. },
  263. {
  264. "key": "year",
  265. "value": "{{year}}",
  266. "description": "四位年份,与 period 一致。"
  267. },
  268. {
  269. "key": "name",
  270. "value": "{{doc_type_keyword}}",
  271. "description": "名称筛选词,默认通风机。"
  272. }
  273. ]
  274. },
  275. "description": "mine 为矿井全称,不是 dept_id。year 与后续采集月份一致,name 为资料类型名称筛选词(默认通风机)。从 data.items 中查找 level3 与 {{report_type}} 完全相等的唯一一行,把该行 file_name_id 填入同名变量。类型编号按矿井和年份动态查询,不沿用其他矿的示例编号。",
  276. "auth": {
  277. "type": "noauth"
  278. }
  279. },
  280. "status": "OK",
  281. "code": 200,
  282. "_postman_previewlanguage": "json",
  283. "header": [
  284. {
  285. "key": "Content-Type",
  286. "value": "application/json"
  287. }
  288. ],
  289. "cookie": [],
  290. "body": "{\n \"data\": {\n \"items\": [\n {\n \"level3\": \"通风机性能测定报告\",\n \"file_name_id\": \"<实际整数类型编号>\"\n }\n ]\n }\n}"
  291. }
  292. ]
  293. },
  294. {
  295. "name": "04 发起报告采集与文件下载任务",
  296. "request": {
  297. "method": "POST",
  298. "header": [
  299. {
  300. "key": "Accept",
  301. "value": "application/json",
  302. "type": "text"
  303. },
  304. {
  305. "key": "Content-Type",
  306. "value": "application/json",
  307. "type": "text"
  308. }
  309. ],
  310. "url": {
  311. "raw": "{{base_url}}/crawl",
  312. "host": [
  313. "{{base_url}}"
  314. ],
  315. "path": [
  316. "crawl"
  317. ]
  318. },
  319. "description": "填写 mine_name、dept_id、year、file_name_id、period。每次提交一个矿、一种资料类型、一个月份。file_name_ids 是整数数组;当前流程传一个动态取得的编号。period 格式为 YYYY-MM,year 与 period 的年份必须一致。dry_run=false 为实际采集。成功响应的 data.task_id 填入 task_id 变量,再查询进度。HTTP 409 表示服务忙;当前接入不假定 409 一定返回任务编号,等待后仅重试相同参数。该接口返回任务信息,文件由服务端后台保存。",
  320. "auth": {
  321. "type": "noauth"
  322. },
  323. "body": {
  324. "mode": "raw",
  325. "raw": "{\n \"mine_name\": \"{{mine_name}}\",\n \"dept_id\": \"{{dept_id}}\",\n \"year\": {{year}},\n \"file_name_ids\": [{{file_name_id}}],\n \"period\": \"{{period}}\",\n \"dry_run\": {{dry_run}}\n}",
  326. "options": {
  327. "raw": {
  328. "language": "json"
  329. }
  330. }
  331. }
  332. },
  333. "response": [
  334. {
  335. "name": "响应结构示意(非实测,字段以实际服务为准)",
  336. "originalRequest": {
  337. "method": "POST",
  338. "header": [
  339. {
  340. "key": "Accept",
  341. "value": "application/json",
  342. "type": "text"
  343. },
  344. {
  345. "key": "Content-Type",
  346. "value": "application/json",
  347. "type": "text"
  348. }
  349. ],
  350. "url": {
  351. "raw": "{{base_url}}/crawl",
  352. "host": [
  353. "{{base_url}}"
  354. ],
  355. "path": [
  356. "crawl"
  357. ]
  358. },
  359. "description": "填写 mine_name、dept_id、year、file_name_id、period。每次提交一个矿、一种资料类型、一个月份。file_name_ids 是整数数组;当前流程传一个动态取得的编号。period 格式为 YYYY-MM,year 与 period 的年份必须一致。dry_run=false 为实际采集。成功响应的 data.task_id 填入 task_id 变量,再查询进度。HTTP 409 表示服务忙;当前接入不假定 409 一定返回任务编号,等待后仅重试相同参数。该接口返回任务信息,文件由服务端后台保存。",
  360. "auth": {
  361. "type": "noauth"
  362. },
  363. "body": {
  364. "mode": "raw",
  365. "raw": "{\n \"mine_name\": \"{{mine_name}}\",\n \"dept_id\": \"{{dept_id}}\",\n \"year\": {{year}},\n \"file_name_ids\": [{{file_name_id}}],\n \"period\": \"{{period}}\",\n \"dry_run\": {{dry_run}}\n}",
  366. "options": {
  367. "raw": {
  368. "language": "json"
  369. }
  370. }
  371. }
  372. },
  373. "status": "OK",
  374. "code": 200,
  375. "_postman_previewlanguage": "json",
  376. "header": [
  377. {
  378. "key": "Content-Type",
  379. "value": "application/json"
  380. }
  381. ],
  382. "cookie": [],
  383. "body": "{\n \"data\": {\n \"task_id\": \"<实际任务编号>\"\n }\n}"
  384. }
  385. ]
  386. },
  387. {
  388. "name": "05 查询采集任务进度",
  389. "request": {
  390. "method": "GET",
  391. "header": [
  392. {
  393. "key": "Accept",
  394. "value": "application/json",
  395. "type": "text"
  396. }
  397. ],
  398. "url": {
  399. "raw": "{{base_url}}/crawl/{{task_id}}",
  400. "host": [
  401. "{{base_url}}"
  402. ],
  403. "path": [
  404. "crawl",
  405. "{{task_id}}"
  406. ]
  407. },
  408. "description": "task_id 来自第 04 步成功响应。读取 data.status:queued/pending/running 为等待或执行中,按项目默认约 3 秒间隔继续查询;done 为完成;partial/failed 为终态失败,不能当作完整资料采集成功。项目默认等待上限 900 秒。完成后原件位于服务端 /home/chief/source_data/{{mine_name}}/{{year}}/{{report_type}}/;此接口返回 JSON 状态,不返回文件二进制。",
  409. "auth": {
  410. "type": "noauth"
  411. }
  412. },
  413. "response": [
  414. {
  415. "name": "响应结构示意(非实测,字段以实际服务为准)",
  416. "originalRequest": {
  417. "method": "GET",
  418. "header": [
  419. {
  420. "key": "Accept",
  421. "value": "application/json",
  422. "type": "text"
  423. }
  424. ],
  425. "url": {
  426. "raw": "{{base_url}}/crawl/{{task_id}}",
  427. "host": [
  428. "{{base_url}}"
  429. ],
  430. "path": [
  431. "crawl",
  432. "{{task_id}}"
  433. ]
  434. },
  435. "description": "task_id 来自第 04 步成功响应。读取 data.status:queued/pending/running 为等待或执行中,按项目默认约 3 秒间隔继续查询;done 为完成;partial/failed 为终态失败,不能当作完整资料采集成功。项目默认等待上限 900 秒。完成后原件位于服务端 /home/chief/source_data/{{mine_name}}/{{year}}/{{report_type}}/;此接口返回 JSON 状态,不返回文件二进制。",
  436. "auth": {
  437. "type": "noauth"
  438. }
  439. },
  440. "status": "OK",
  441. "code": 200,
  442. "_postman_previewlanguage": "json",
  443. "header": [
  444. {
  445. "key": "Content-Type",
  446. "value": "application/json"
  447. }
  448. ],
  449. "cookie": [],
  450. "body": "{\n \"data\": {\n \"status\": \"done\"\n }\n}"
  451. }
  452. ]
  453. }
  454. ]
  455. }