Sprint 1-3 Completed (Backend + Frontend): Backend (Sprint 1-2): - Implement 5-layer Agent framework (Query->Planner->Executor->Tools->Reflection) - Create agent_schema with 6 tables (agent_definitions, stages, prompts, sessions, traces, reflexion_rules) - Create protocol_schema with 2 tables (protocol_contexts, protocol_generations) - Implement Protocol Agent core services (Orchestrator, ContextService, PromptBuilder) - Integrate LLM service adapter (DeepSeek/Qwen/GPT-5/Claude) - 6 API endpoints with full authentication - 10/10 API tests passed Frontend (Sprint 3): - Add Protocol Agent entry in AgentHub (indigo theme card) - Implement ProtocolAgentPage with 3-column layout - Collapsible sidebar (Gemini style, 48px <-> 280px) - StatePanel with 5 stage cards (scientific_question, pico, study_design, sample_size, endpoints) - ChatArea with sync button and action cards integration - 100% prototype design restoration (608 lines CSS) - Detailed endpoints structure: baseline, exposure, outcomes, confounders Features: - 5-stage dialogue flow for research protocol design - Conversation-driven interaction with sync-to-protocol button - Real-time context state management - One-click protocol generation button (UI ready, backend pending) Database: - agent_schema: 6 tables for reusable Agent framework - protocol_schema: 2 tables for Protocol Agent - Seed data: 1 agent + 5 stages + 9 prompts + 4 reflexion rules Code Stats: - Backend: 13 files, 4338 lines - Frontend: 14 files, 2071 lines - Total: 27 files, 6409 lines Status: MVP core functionality completed, pending frontend-backend integration testing Next: Sprint 4 - One-click protocol generation + Word export
65 lines
2.1 KiB
TypeScript
65 lines
2.1 KiB
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('\n=== 各模块数据量检查 ===\n');
|
|
|
|
// 检查各个模块的数据
|
|
const queries = [
|
|
{ name: 'aia_schema.projects', sql: 'SELECT COUNT(*) as count FROM aia_schema.projects' },
|
|
{ name: 'aia_schema.conversations', sql: 'SELECT COUNT(*) as count FROM aia_schema.conversations' },
|
|
{ name: 'asl_schema.screening_projects', sql: 'SELECT COUNT(*) as count FROM asl_schema.screening_projects' },
|
|
{ name: 'asl_schema.literatures', sql: 'SELECT COUNT(*) as count FROM asl_schema.literatures' },
|
|
{ name: 'dc_schema.dc_templates', sql: 'SELECT COUNT(*) as count FROM dc_schema.dc_templates' },
|
|
{ name: 'dc_schema.dc_extraction_tasks', sql: 'SELECT COUNT(*) as count FROM dc_schema.dc_extraction_tasks' },
|
|
{ name: 'iit_schema.projects', sql: 'SELECT COUNT(*) as count FROM iit_schema.projects' },
|
|
{ name: 'pkb_schema.knowledge_bases', sql: 'SELECT COUNT(*) as count FROM pkb_schema.knowledge_bases' },
|
|
{ name: 'pkb_schema.documents', sql: 'SELECT COUNT(*) as count FROM pkb_schema.documents' },
|
|
{ name: 'platform_schema.users', sql: 'SELECT COUNT(*) as count FROM platform_schema.users' },
|
|
{ name: 'platform_schema.tenants', sql: 'SELECT COUNT(*) as count FROM platform_schema.tenants' },
|
|
{ name: 'platform_schema.departments', sql: 'SELECT COUNT(*) as count FROM platform_schema.departments' },
|
|
{ name: 'capability_schema.prompt_templates', sql: 'SELECT COUNT(*) as count FROM capability_schema.prompt_templates' },
|
|
];
|
|
|
|
for (const q of queries) {
|
|
try {
|
|
const result: any = await prisma.$queryRawUnsafe(q.sql);
|
|
console.log(`${q.name}: ${result[0].count} 条记录`);
|
|
} catch (e: any) {
|
|
console.log(`${q.name}: 查询失败 - ${e.message}`);
|
|
}
|
|
}
|
|
|
|
// 检查 platform_schema.users 的具体数据
|
|
console.log('\n=== platform_schema.users 详情 ===');
|
|
const users = await prisma.$queryRaw`SELECT id, name, phone, role, tenant_id FROM platform_schema.users;`;
|
|
console.log(users);
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|