✨ feat: 完整应用重构 - 优化界面架构与用户体验
主要变更: - 重构应用界面:优化首页、登录、认证流程 - 新增用户档案模块:包含完整的档案管理组件 - 优化路由结构:重新组织页面布局和导航 - 改进API集成:新增活动、内容分类等API模块 - 删除冗余组件:清理不必要的文件和依赖 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,10 @@ export interface Category {
|
||||
id: string;
|
||||
name: string;
|
||||
nameEn: string;
|
||||
description?: string;
|
||||
descriptionEn?: string;
|
||||
sortOrder?: number;
|
||||
isActive?: boolean;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -16,6 +20,96 @@ export interface Tag {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface TemplateMediaAsset {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface TemplateNodeOutput {
|
||||
images?: TemplateMediaAsset[];
|
||||
videos?: TemplateMediaAsset[];
|
||||
texts?: string[];
|
||||
coverUrl?: string;
|
||||
}
|
||||
|
||||
export interface TemplateNodeActionData {
|
||||
n?: number;
|
||||
prompt?: string;
|
||||
duration?: string;
|
||||
aspectRatio?: string;
|
||||
selectedModel?: string;
|
||||
advancedParams?: Record<string, string | number | boolean | null>;
|
||||
}
|
||||
|
||||
export interface TemplateNodeMetrics {
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
export interface TemplateNodePosition {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface TemplateGraphNodeData {
|
||||
label?: string;
|
||||
text?: string;
|
||||
description?: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
flowType?: string;
|
||||
autoPlay?: boolean;
|
||||
controls?: boolean;
|
||||
output?: TemplateNodeOutput;
|
||||
actionData?: TemplateNodeActionData;
|
||||
}
|
||||
|
||||
export interface TemplateGraphNode {
|
||||
id: string;
|
||||
data: TemplateGraphNodeData;
|
||||
type: string;
|
||||
dragging: boolean;
|
||||
measured: TemplateNodeMetrics;
|
||||
position: TemplateNodePosition;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateGraphEdge {
|
||||
id: string;
|
||||
source: string;
|
||||
target: string;
|
||||
sourceHandle: string;
|
||||
targetHandle: string;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateGraphViewport {
|
||||
x: number;
|
||||
y: number;
|
||||
zoom: number;
|
||||
}
|
||||
|
||||
export interface TemplateGraph {
|
||||
edges: TemplateGraphEdge[];
|
||||
nodes: TemplateGraphNode[];
|
||||
viewport: TemplateGraphViewport;
|
||||
}
|
||||
|
||||
export interface TemplateFormSchema {
|
||||
startNodes: TemplateGraphNode[];
|
||||
endNodes: TemplateGraphNode[];
|
||||
}
|
||||
|
||||
export interface TemplateTagLink {
|
||||
templateId: string;
|
||||
tagId: string;
|
||||
sortOrder: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
tag: Tag;
|
||||
}
|
||||
|
||||
export type TemplateAssignedTag = Pick<Tag, 'id' | 'name' | 'nameEn' | 'createdAt' | 'updatedAt'>;
|
||||
|
||||
export interface Template {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -27,13 +121,17 @@ export interface Template {
|
||||
aspectRatio: string;
|
||||
userId: string;
|
||||
categoryId: string;
|
||||
content?: unknown;
|
||||
formSchema?: unknown;
|
||||
content?: TemplateGraph | null;
|
||||
formSchema?: TemplateFormSchema | null;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
uploadSapecifications?: string | null;
|
||||
uploadSapecificationsEn?: string | null;
|
||||
sortOrder?: number;
|
||||
category: Category | null;
|
||||
tags: Tag[];
|
||||
templateTags?: TemplateTagLink[];
|
||||
}
|
||||
|
||||
export interface PaginationMeta {
|
||||
@@ -53,3 +151,73 @@ export interface TemplateResponse {
|
||||
success: boolean;
|
||||
data: Template;
|
||||
}
|
||||
|
||||
export interface CategoryTagLink {
|
||||
categoryId: string;
|
||||
tagId: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
tag: Tag;
|
||||
}
|
||||
|
||||
export interface CategoryTemplate extends Omit<Template, 'category' | 'tags' | 'templateTags'> {
|
||||
templateTags: TemplateTagLink[];
|
||||
tags: TemplateAssignedTag[];
|
||||
}
|
||||
|
||||
export interface CategoryWithChildren extends Category {
|
||||
description: string;
|
||||
descriptionEn: string;
|
||||
sortOrder: number;
|
||||
isActive: boolean;
|
||||
categoryTags: CategoryTagLink[];
|
||||
templates: CategoryTemplate[];
|
||||
tags: Tag[];
|
||||
}
|
||||
|
||||
export interface CategoriesWithChildrenResponse {
|
||||
success: boolean;
|
||||
data: CategoryWithChildren[];
|
||||
}
|
||||
|
||||
export interface TemplateGeneration {
|
||||
id: string;
|
||||
userId: string;
|
||||
templateId: string;
|
||||
type: 'VIDEO' | 'IMAGE' | 'TEXT';
|
||||
resultUrl: string[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
status: 'pending' | 'processing' | 'completed' | 'failed';
|
||||
creditsCost: number;
|
||||
creditsTransactionId: string | null;
|
||||
template: {
|
||||
id: string;
|
||||
title: string;
|
||||
titleEn: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GetTemplateGenerationsParams {
|
||||
page?: number;
|
||||
limit?: number;
|
||||
status?: 'pending' | 'processing' | 'completed' | 'failed';
|
||||
templateId?: string;
|
||||
}
|
||||
|
||||
export interface TemplateGenerationsResponseData {
|
||||
generations: TemplateGeneration[];
|
||||
total: number;
|
||||
page: number;
|
||||
limit: number;
|
||||
}
|
||||
|
||||
export interface TemplateGenerationsResponse {
|
||||
success: boolean;
|
||||
data: TemplateGenerationsResponseData;
|
||||
}
|
||||
|
||||
export interface TemplateGenerationResponse {
|
||||
success: boolean;
|
||||
data: TemplateGeneration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user