Summary: - Implement DC module Portal page with 3 tool cards - Create ToolCard component with decorative background and hover animations - Implement TaskList component with table layout and progress bars - Implement AssetLibrary component with tab switching and file cards - Complete database verification (4 tables confirmed) - Complete backend API verification (6 endpoints ready) - Optimize UI to match prototype design (V2.html) Frontend Components (~715 lines): - components/ToolCard.tsx - Tool cards with animations - components/TaskList.tsx - Recent tasks table view - components/AssetLibrary.tsx - Data asset library with tabs - hooks/useRecentTasks.ts - Task state management - hooks/useAssets.ts - Asset state management - pages/Portal.tsx - Main portal page - types/portal.ts - TypeScript type definitions Backend Verification: - Backend API: 1495 lines code verified - Database: dc_schema with 4 tables verified - API endpoints: 6 endpoints tested (templates API works) Documentation: - Database verification report - Backend API test report - Phase 1 completion summary - UI optimization report - Development task checklist - Development plan for Tool B Status: Phase 1 completed (100%), ready for browser testing Next: Phase 2 - Tool B Step 1 and 2 development
283 lines
7.6 KiB
HTTP
283 lines
7.6 KiB
HTTP
###
|
||
# 全文复筛API测试
|
||
# 使用REST Client插件运行(VS Code)
|
||
###
|
||
|
||
@baseUrl = http://localhost:3001
|
||
@apiPrefix = /api/v1/asl/fulltext-screening
|
||
|
||
### ========================================
|
||
### 准备工作:获取已有项目和文献
|
||
### ========================================
|
||
|
||
### 1. 获取项目列表
|
||
GET {{baseUrl}}/api/v1/asl/projects
|
||
Content-Type: application/json
|
||
|
||
### 2. 获取项目文献列表(替换projectId)
|
||
@projectId = 55941145-bba0-4b15-bda4-f0a398d78208
|
||
GET {{baseUrl}}/api/v1/asl/projects/{{projectId}}/literatures?page=1&limit=10
|
||
Content-Type: application/json
|
||
|
||
### ========================================
|
||
### API 1: 创建全文复筛任务
|
||
### ========================================
|
||
|
||
### 测试1.1: 创建任务(正常情况)
|
||
# @name createTask
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "{{projectId}}",
|
||
"literatureIds": [
|
||
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12",
|
||
"e44ea8d9-6ba8-4b88-8d24-4fb46b3584e0"
|
||
],
|
||
"modelA": "deepseek-v3",
|
||
"modelB": "qwen-max",
|
||
"promptVersion": "v1.0.0"
|
||
}
|
||
|
||
### 保存taskId
|
||
@taskId = {{createTask.response.body.data.taskId}}
|
||
|
||
### 测试1.2: 创建任务(缺少必填参数)
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "{{projectId}}"
|
||
}
|
||
|
||
### 测试1.3: 创建任务(projectId不存在)
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "00000000-0000-0000-0000-000000000000",
|
||
"literatureIds": ["lit-001"]
|
||
}
|
||
|
||
### 测试1.4: 创建任务(literatureIds为空)
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "{{projectId}}",
|
||
"literatureIds": []
|
||
}
|
||
|
||
### ========================================
|
||
### API 2: 获取任务进度
|
||
### ========================================
|
||
|
||
### 测试2.1: 获取任务进度(正常情况)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}
|
||
Content-Type: application/json
|
||
|
||
### 测试2.2: 获取任务进度(taskId不存在)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/00000000-0000-0000-0000-000000000000
|
||
Content-Type: application/json
|
||
|
||
### 测试2.3: 等待5秒后再次查询进度
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}
|
||
Content-Type: application/json
|
||
|
||
### ========================================
|
||
### API 3: 获取任务结果
|
||
### ========================================
|
||
|
||
### 测试3.1: 获取所有结果(默认参数)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results
|
||
Content-Type: application/json
|
||
|
||
### 测试3.2: 获取所有结果(第一页,每页10条)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?page=1&pageSize=10
|
||
Content-Type: application/json
|
||
|
||
### 测试3.3: 仅获取冲突项
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=conflict
|
||
Content-Type: application/json
|
||
|
||
### 测试3.4: 仅获取待审核项
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=pending
|
||
Content-Type: application/json
|
||
|
||
### 测试3.5: 仅获取已审核项
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=reviewed
|
||
Content-Type: application/json
|
||
|
||
### 测试3.6: 按优先级降序排序
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?sortBy=priority&sortOrder=desc
|
||
Content-Type: application/json
|
||
|
||
### 测试3.7: 按创建时间升序排序
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?sortBy=createdAt&sortOrder=asc
|
||
Content-Type: application/json
|
||
|
||
### 测试3.8: 分页测试(第2页)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?page=2&pageSize=5
|
||
Content-Type: application/json
|
||
|
||
### 测试3.9: 无效的filter参数
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?filter=invalid
|
||
Content-Type: application/json
|
||
|
||
### 测试3.10: 无效的pageSize(超过最大值)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?pageSize=999
|
||
Content-Type: application/json
|
||
|
||
### ========================================
|
||
### API 4: 人工审核决策
|
||
### ========================================
|
||
|
||
### 先获取一个结果ID
|
||
# @name getFirstResult
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/results?pageSize=1
|
||
Content-Type: application/json
|
||
|
||
### 保存resultId
|
||
@resultId = {{getFirstResult.response.body.data.results[0].resultId}}
|
||
|
||
### 测试4.1: 更新决策为纳入
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "include",
|
||
"reviewNotes": "经人工审核,确认纳入"
|
||
}
|
||
|
||
### 测试4.2: 更新决策为排除(带排除原因)
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "exclude",
|
||
"exclusionReason": "关键字段field9(结局指标)数据不完整",
|
||
"reviewNotes": "仅报告P值,缺少均值±SD"
|
||
}
|
||
|
||
### 测试4.3: 排除但不提供排除原因(应该失败)
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "exclude"
|
||
}
|
||
|
||
### 测试4.4: 无效的finalDecision值
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/{{resultId}}/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "maybe"
|
||
}
|
||
|
||
### 测试4.5: resultId不存在
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/00000000-0000-0000-0000-000000000000/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "include"
|
||
}
|
||
|
||
### ========================================
|
||
### API 5: 导出Excel
|
||
### ========================================
|
||
|
||
### 测试5.1: 导出Excel(正常情况)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{taskId}}/export
|
||
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||
|
||
### 测试5.2: 导出Excel(taskId不存在)
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/00000000-0000-0000-0000-000000000000/export
|
||
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||
|
||
### ========================================
|
||
### 完整流程测试
|
||
### ========================================
|
||
|
||
### 完整流程1: 创建任务
|
||
# @name fullFlowTask
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "{{projectId}}",
|
||
"literatureIds": [
|
||
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12"
|
||
],
|
||
"modelA": "deepseek-v3",
|
||
"modelB": "qwen-max"
|
||
}
|
||
|
||
@fullFlowTaskId = {{fullFlowTask.response.body.data.taskId}}
|
||
|
||
### 完整流程2: 等待2秒后查询进度
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}
|
||
Content-Type: application/json
|
||
|
||
### 完整流程3: 获取结果
|
||
# @name fullFlowResults
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}/results
|
||
Content-Type: application/json
|
||
|
||
@fullFlowResultId = {{fullFlowResults.response.body.data.results[0].resultId}}
|
||
|
||
### 完整流程4: 审核决策
|
||
PUT {{baseUrl}}{{apiPrefix}}/results/{{fullFlowResultId}}/decision
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"finalDecision": "include",
|
||
"reviewNotes": "完整流程测试 - 确认纳入"
|
||
}
|
||
|
||
### 完整流程5: 导出Excel
|
||
GET {{baseUrl}}{{apiPrefix}}/tasks/{{fullFlowTaskId}}/export
|
||
Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||
|
||
### ========================================
|
||
### 压力测试(批量文献)
|
||
### ========================================
|
||
|
||
### 批量测试: 创建包含多篇文献的任务
|
||
POST {{baseUrl}}{{apiPrefix}}/tasks
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"projectId": "{{projectId}}",
|
||
"literatureIds": [
|
||
"e9c18ba3-9ad7-4cc9-ac78-b74a7ec91b12",
|
||
"e44ea8d9-6ba8-4b88-8d24-4fb46b3584e0",
|
||
"c8f9e2d1-3a4b-5c6d-7e8f-9a0b1c2d3e4f"
|
||
],
|
||
"modelA": "deepseek-v3",
|
||
"modelB": "qwen-max"
|
||
}
|
||
|
||
### ========================================
|
||
### 清理测试数据(可选)
|
||
### ========================================
|
||
|
||
### 注意:以下操作会删除测试数据,请谨慎使用
|
||
|
||
### 查询所有任务
|
||
GET {{baseUrl}}/api/v1/asl/projects/{{projectId}}/literatures
|
||
Content-Type: application/json
|
||
|
||
###
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|