ai-business-write/技术文档/测试准备就绪.md

87 lines
1.8 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.

# 测试准备就绪 ✅
## 所有检查已完成
### ✅ 依赖检查
- ✓ 所有9个依赖包已安装
- ✓ 所有模块可以正常导入
### ✅ 数据库检查
-`template_code` 字段存在
- ✓ 13个文件配置记录已配置template_code
- ✓ 85个字段记录已初始化
### ✅ 服务检查
- ✓ 字段服务可以正常查询
- ✓ 文档服务初始化成功
- ✓ AI服务初始化成功需要配置API密钥
---
## 🚀 现在可以开始测试
### 方法1启动服务并手动测试
**步骤1启动服务**
在当前终端运行:
```bash
python app.py
```
**步骤2在新终端运行测试**
打开新终端窗口,运行:
```bash
python test_complete.py
```
### 方法2使用测试脚本
直接运行完整的测试脚本:
```bash
python test_api.py
```
---
## 📝 快速测试命令
### 测试解析接口
```bash
curl -X POST http://localhost:7500/ai/extract -H "Content-Type: application/json" -d "{\"inputData\":[{\"fieldCode\":\"clue_info\",\"fieldValue\":\"被举报用户名称是张三年龄30岁\"}],\"outputData\":[{\"fieldCode\":\"target_name\"}]}"
```
### 访问测试页面
打开浏览器访问:
- 主页http://localhost:7500/
- API文档http://localhost:7500/api-docs
---
## ⚠️ 注意事项
1. **AI API密钥**:如果测试解析接口,需要配置 `SILICONFLOW_API_KEY``.env` 文件中
2. **文档生成**如果需要测试文档生成接口需要确保MinIO配置正确
3. **数据库**:所有数据已准备就绪,无需额外初始化
---
## 📊 预期测试结果
### 解析接口测试
- 应该能成功提取字段值
- 返回格式应符合接口文档
### 文档生成接口测试
- 如果MinIO配置正确应该能成功生成文档
- 返回相对路径格式
---
**准备完成!可以开始测试了!** 🎉