report-detect/interface-checklist.md

22 lines
2.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 接口清单(前端需求)
来源:`refer/认监-扫描件识别/frontend/report-detect-web/src/api/*.js` 及页面直接拼接的接口。
| # | Method | Path | 用途(前端) | 前端引用 | 状态 | 备注 |
|---|---|---|---|---|
| 1 | POST | `/api/login` | 登录 | `src/api/user.js` | ✅ 已修正 | 后端改为 `data=token`(字符串),并保留 `tokenName` 字段 |
| 2 | POST | `/api/logout` | 退出登录 | `src/api/user.js` | ✅ 已核对 | 后端存在:`src/main/java/com/chinaweal/youfool/reportdetect/modules/task/controller/TaskController.java`,返回 `code=0` |
| 3 | GET | `/api/user/info` | 用户信息 | `src/api/user.js` | ✅ 已修正 | 现返回 `name/avatar/roles`,并将角色转为小写 |
| 4 | GET | `/api/sys/institutions` | 机构列表 | `src/api/user.js` | ✅ 已核对 | 返回 `id/name/cmaNumber` 列表,前端可直接使用 |
| 5 | POST | `/api/auditor/switch-institution` | 切换机构 | `src/api/user.js` | ✅ 已核对 | 后端存在并接收 `{ institutionId }` |
| 6 | GET | `/api/statistics` | 报告统计 | `src/api/report.js` | ✅ 已修正 | 新增接口并返回 `{待审核报告, 已通过报告, 驳回报告, 本月审核量}` |
| 7 | GET | `/api/reports` | 报告列表 | `src/api/report.js` | ✅ 已修正 | 支持 `status` 过滤并返回前端表格字段(含 `approval_id`、`报告编号`、`检测机构`、`提交时间`、`状态` |
| 8 | GET | `/api/reports/{id}` | 报告详情 | `src/api/report.js` | ✅ 已修正 | 返回 `status(0/1/2/3)`、`report_id`、`report_type`、`institution`、`submit_time`、`testing_date`、`audit_opinion`、`ocr_result`、`attachments`、`history` |
| 9 | GET | `/api/reports/{id}/preview` | 报告预览(图片/历史) | `src/api/report.js` | ✅ 已修正 | 返回 `ocr_result.API核验/org_exists/cma_exists`,并附带 `pages/history``status` |
| 10 | POST | `/api/tasks` | 创建识别任务 | `src/api/report.js` | ✅ 已修正 | 支持 `product_name/testing_date/contact_phone` 等表单字段 |
| 11 | POST | `/api/reports/{id}/submit` | 用户确认提交 | `src/api/report.js` | ✅ 已修正 | OCR 通过后将状态置为 `pending` 并记录历史 |
| 12 | POST | `/api/reports/{id}/audit` | 审核提交 | `src/api/report.js` | ✅ 已修正 | 支持 `status/opinion/files`,保存附件并记录历史 |
| 13 | DELETE | `/api/reports/{id}` | 删除报告 | `src/api/report.js` | | |
| 14 | POST | `/api/validate-cma` | CMA 校验 | `src/api/report.js` | | |
| 15 | GET | `/api/reports/{id}/pdf` | PDF 预览 | `src/views/shibieneirong/shenhe/index.vue` | | |