AIA V2.0 Major Updates: - Add StreamingService with OpenAI Compatible format (backend/common/streaming) - Upgrade Chat component V2 with Ant Design X deep integration - Implement 12 intelligent agents (5 phases: topic/design/review/data/writing) - Create AgentHub with 100% prototype V11 restoration - Create ChatWorkspace with fullscreen immersive experience - Add ThinkingBlock for deep thinking display - Add useAIStream Hook for stream handling - Add ConversationList for conversation management Backend (~1300 lines): - common/streaming: OpenAI adapter and streaming service - modules/aia: 12 agents config, conversation service, attachment service - Unified API routes to /api/v1 (RVW, PKB, AIA modules) - Update authentication and permission helpers Frontend (~3500 lines): - modules/aia: AgentHub + ChatWorkspace + AgentCard components - shared/Chat: AIStreamChat, ThinkingBlock, useAIStream, useConversations - Update all modules API endpoints to v1 - Modern design with theme colors (blue/yellow/teal/purple) Documentation (~2500 lines): - AIA module status and development guide - Universal capabilities catalog (11 services) - Quick reference card - System overview updates - All module documentation synchronization Other Updates: - DC Tool C: Python operations and frontend components - IIT Manager: session memory and wechat service - PKB/RVW/ASL: API route updates - Docker configs and deployment scripts - Database migrations and scripts - Test files and documentation Tested: AIA streaming verified, authentication working, core features functional Status: AIA V2.0 completed (85%), all changes synchronized
81 lines
2.5 KiB
TypeScript
81 lines
2.5 KiB
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('🔍 检查 RVW 模块问题\n');
|
|
|
|
// 1. 检查用户 user-mock-001 是否存在
|
|
console.log('1. 检查用户 "user-mock-001":');
|
|
const users: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, email, phone, role
|
|
FROM platform_schema.users
|
|
WHERE id = 'user-mock-001' OR email LIKE '%mock%' OR name LIKE '%mock%'
|
|
`;
|
|
|
|
if (users.length === 0) {
|
|
console.log(' ❌ 用户 "user-mock-001" 不存在!');
|
|
} else {
|
|
console.log(' ✅ 找到用户:');
|
|
users.forEach(u => console.log(` ${u.id}: ${u.name} (${u.email || u.phone})`));
|
|
}
|
|
|
|
// 2. 检查所有用户
|
|
console.log('\n2. 当前所有用户:');
|
|
const allUsers: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, phone, role FROM platform_schema.users
|
|
`;
|
|
allUsers.forEach(u => console.log(` - ${u.id}: ${u.name} (${u.phone}) [${u.role}]`));
|
|
|
|
// 3. 检查 rvw_schema.review_tasks 表结构
|
|
console.log('\n3. rvw_schema.review_tasks 表结构:');
|
|
const cols: any[] = await prisma.$queryRaw`
|
|
SELECT column_name, data_type, is_nullable, column_default
|
|
FROM information_schema.columns
|
|
WHERE table_schema = 'rvw_schema' AND table_name = 'review_tasks'
|
|
ORDER BY ordinal_position
|
|
`;
|
|
cols.forEach(c => {
|
|
const nullable = c.is_nullable === 'YES' ? 'NULLABLE' : 'NOT NULL';
|
|
console.log(` ${c.column_name}: ${c.data_type} ${nullable}`);
|
|
});
|
|
|
|
// 4. 检查外键约束
|
|
console.log('\n4. review_tasks 的外键约束:');
|
|
const fks: any[] = await prisma.$queryRaw`
|
|
SELECT
|
|
tc.constraint_name,
|
|
kcu.column_name,
|
|
ccu.table_schema AS foreign_table_schema,
|
|
ccu.table_name AS foreign_table_name,
|
|
ccu.column_name AS foreign_column_name
|
|
FROM information_schema.table_constraints AS tc
|
|
JOIN information_schema.key_column_usage AS kcu
|
|
ON tc.constraint_name = kcu.constraint_name
|
|
JOIN information_schema.constraint_column_usage AS ccu
|
|
ON ccu.constraint_name = tc.constraint_name
|
|
WHERE tc.constraint_type = 'FOREIGN KEY'
|
|
AND tc.table_schema = 'rvw_schema'
|
|
AND tc.table_name = 'review_tasks'
|
|
`;
|
|
|
|
if (fks.length === 0) {
|
|
console.log(' 无外键约束');
|
|
} else {
|
|
fks.forEach(fk => {
|
|
console.log(` ${fk.column_name} -> ${fk.foreign_table_schema}.${fk.foreign_table_name}.${fk.foreign_column_name}`);
|
|
});
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|