feat(web): 初始化前端基础架构和样式

- 新增.gitignore,忽略日志、node_modules、dist及编辑器配置文件
- 创建基础React应用及组件App,集成React、Vite和样式
- 设计响应式CSS变量和全局样式,支持暗黑模式
- 新增图标SVG符号定义,用于社交及文档链接展示
- 配置TypeScript项目(tsconfig)和ESLint规则保障代码质量
- 配置Vite开发服务器,支持代理接口与模块别名
- 增加前端API客户端封装与健康检查接口定义
- 增加类型定义文件,映射后端数据模型接口
- 创建index.html作为前端入口页面
- 新增package.json定义依赖和运行脚本,包含React及Ant Design等库
This commit is contained in:
yangzhaohan
2026-07-21 21:53:34 +08:00
parent 66db64267c
commit b7cc3c4265
33 changed files with 542 additions and 14 deletions
+49
View File
@@ -0,0 +1,49 @@
// ---- 对应 Go: internal/core/base_model.go ----
export interface BaseModel {
id: number
created_at: number
created_time: string // time.Time → ISO 8601
updated_at: number
updated_time: string
del_flag: number
}
// ---- 对应 Go: internal/enum/enabled_status.go ----
export type Status = 0 | 1 // 0=Disabled, 1=Enabled
// ---- 对应 Go: internal/model/provider.go ----
export interface Provider extends BaseModel {
name: string
base_url: string
status: Status
}
// ---- 对应 Go: internal/model/model.go ----
export type ModelType = 'chat' | 'completion' | 'embedding' | 'image'
export interface AIModel extends BaseModel {
provider_id: number
name: string
model_type: ModelType
status: Status
}
// ---- 对应 Go: internal/model/channel.go ----
export interface Channel extends BaseModel {
name: string
provider_id: number
model_id: number | null // Go *int64 → null | number
weight: number
priority: number
rate_limit: number
status: Status
}
// ---- 对应 Go: internal/model/api_key.go ----
export interface APIKey extends BaseModel {
key: string
name: string
rate_limit: number
status: Status
expired_at: string | null // Go *time.Time → null | ISO 8601
}