注册征信解析Mock路由并补充说明
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
# 流水分析 Mock 服务器
|
||||
|
||||
基于 Python + FastAPI 的独立 Mock 服务器,用于模拟流水分析平台的 7 个核心接口。
|
||||
基于 Python + FastAPI 的独立 Mock 服务器,用于模拟流水分析平台的 7 个核心接口,并提供征信解析 Mock 能力。
|
||||
|
||||
## ✨ 特性
|
||||
|
||||
- ✅ **完整的接口模拟** - 实现所有 7 个核心接口
|
||||
- ✅ **文件解析延迟** - 使用 FastAPI 后台任务模拟 4 秒解析延迟
|
||||
- ✅ **错误场景触发** - 通过 `error_XXXX` 标记触发所有 8 个错误码
|
||||
- ✅ **征信解析 Mock** - 支持稳定随机生成三大主题域征信 `payload`
|
||||
- ✅ **自动 API 文档** - Swagger UI 和 ReDoc 自动生成
|
||||
- ✅ **配置驱动** - JSON 模板文件,易于修改响应数据
|
||||
- ✅ **零配置启动** - 开箱即用,无需数据库
|
||||
@@ -100,6 +101,44 @@ response = requests.post(
|
||||
)
|
||||
```
|
||||
|
||||
### 征信解析 Mock
|
||||
|
||||
```bash
|
||||
curl -s -X POST http://localhost:8000/xfeature-mngs/conversation/htmlEval \
|
||||
-F model=LXCUSTALL \
|
||||
-F hType=PERSON \
|
||||
-F file=@./sample-credit.html
|
||||
```
|
||||
|
||||
成功时返回:
|
||||
|
||||
```json
|
||||
{
|
||||
"message": "成功",
|
||||
"status_code": "0",
|
||||
"payload": {
|
||||
"lx_header": {},
|
||||
"lx_debt": {},
|
||||
"lx_publictype": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
调试错误码时,可在 `model` 中追加错误标记:
|
||||
|
||||
```bash
|
||||
curl -s -X POST http://localhost:8000/xfeature-mngs/conversation/htmlEval \
|
||||
-F model=error_ERR_10001 \
|
||||
-F hType=PERSON \
|
||||
-F file=@./sample-credit.html
|
||||
```
|
||||
|
||||
健康检查:
|
||||
|
||||
```bash
|
||||
curl -s http://localhost:8000/credit/health
|
||||
```
|
||||
|
||||
### 错误场景测试
|
||||
|
||||
```python
|
||||
@@ -213,6 +252,8 @@ pytest tests/ -v --cov=. --cov-report=html
|
||||
| 4 | POST | `/watson/api/project/upload/getpendings` | 检查解析状态 |
|
||||
| 5 | POST | `/watson/api/project/batchDeleteUploadFile` | 删除文件 |
|
||||
| 6 | POST | `/watson/api/project/getBSByLogId` | 获取银行流水 |
|
||||
| 7 | POST | `/xfeature-mngs/conversation/htmlEval` | 征信解析 Mock |
|
||||
| 8 | GET | `/credit/health` | 征信解析健康检查 |
|
||||
|
||||
## ⚠️ 错误码列表
|
||||
|
||||
|
||||
Reference in New Issue
Block a user