refactor: 主要功能实现

目前的工作已经实现的功能:
- 基本 FastAPI 路由;
- 基本 AI 聊天和创作功能;
- 用户信息管理、权限验证、JWT 令牌签发和验证、端点保护;
- HTML 验证码邮件发送和验证码验证。
This commit is contained in:
2026-05-24 13:58:51 +08:00
parent f06de85257
commit 21f0d7725e
98 changed files with 6483 additions and 116 deletions
+39
View File
@@ -0,0 +1,39 @@
/**
* /api/aii/model 端点返回的模型数据,包含冰冷的 provider id 以及查询得到的温暖的 provider name 和 base url。
*
* 创建新模型不使用此 interface。
*/
export interface AiiModelPublic {
id: number
model_name: string
max_context_length: number
provider_id: number
provider_name: string
base_url: string
}
export interface AiiProviderPublic {
id: number
name: string
base_url: string
api_key: string
}
export interface AiiProviderPublicWithoutKey {
id: number
name: string
base_url: string
}
export interface AiiTokenInfo {
type: 'usage'
completion_tokens: number
completion_tokens_details: object
prompt_tokens: number
prompt_tokens_details: object
total_tokens: number
// DeepSeek
prompt_cache_hit_tokens?: number
// DeepSeek
prompt_cache_miss_tokens?: number
}
+26
View File
@@ -0,0 +1,26 @@
export interface ChatroomPublic {
id: number
name: string
description: string
feature_image: string
script_template_id: number
script_template_version: string
}
export interface Chatroom extends ChatroomPublic {
script: string
content: string
}
export interface WordBook {
key_word: string
message: string
}
export interface ChatScript {
main_prompt: string
user_prefix: string
user_suffix: string
world_books: WordBook[]
}
+5
View File
@@ -0,0 +1,5 @@
export interface ReturnDto {
success: boolean
message?: string
result?: unknown
}
+1
View File
@@ -0,0 +1 @@
export const SEE_YOU_TOMORROW = '... . . -.-- --- ..- - --- -- --- .-. .-. --- .--'
+22
View File
@@ -0,0 +1,22 @@
export interface UserDto {
id: number
name: string
display_name: string
avatar_url: string
background_url: string
description: string
email: string
phone: string
is_admin: boolean
}
export interface UploadFileDto {
id: number
original_name: string
safe_name: string
download_url: string
uploader_id: number
}