feat(frontend): Day 6 - frontend basic architecture completed

This commit is contained in:
AI Clinical Dev Team
2025-10-10 17:22:37 +08:00
parent 0db54b2d31
commit f7a500bc79
20 changed files with 6718 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
// 用户类型
export interface User {
id: string
email: string
name?: string
avatarUrl?: string
role: 'user' | 'admin'
}
// 项目类型
export interface Project {
id: string
userId: string
name: string
description: string
conversationCount: number
createdAt: string
updatedAt: string
}
// 会话类型
export interface Conversation {
id: string
userId: string
projectId?: string
agentId: string
title: string
modelName: string
messageCount: number
totalTokens: number
createdAt: string
updatedAt: string
}
// 消息类型
export interface Message {
id: string
conversationId: string
role: 'user' | 'assistant'
content: string
metadata?: {
kbReferences?: string[]
citations?: any[]
modelParams?: any
}
tokens?: number
isPinned: boolean
createdAt: string
}
// 知识库类型
export interface KnowledgeBase {
id: string
userId: string
name: string
description?: string
difyDatasetId: string
fileCount: number
totalSizeBytes: number
createdAt: string
updatedAt: string
}
// 文档类型
export interface Document {
id: string
kbId: string
userId: string
filename: string
fileType: string
fileSizeBytes: number
fileUrl: string
difyDocumentId: string
status: 'uploading' | 'processing' | 'completed' | 'failed'
progress: number
errorMessage?: string
segmentsCount?: number
tokensCount?: number
uploadedAt: string
processedAt?: string
}
// API响应类型
export interface ApiResponse<T = any> {
success: boolean
data: T
message?: string
}