1
This commit is contained in:
@@ -0,0 +1,171 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
avatar?: string;
|
||||
credits: number;
|
||||
isAdmin: boolean;
|
||||
userType: string;
|
||||
allowedMenus?: string[] | null;
|
||||
}
|
||||
|
||||
export interface CreditRecord {
|
||||
id: string;
|
||||
type: 'consume' | 'recharge';
|
||||
amount: number;
|
||||
description: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export type Industry =
|
||||
| 'ecommerce'
|
||||
| 'education'
|
||||
| 'gaming'
|
||||
| 'medical'
|
||||
| 'finance'
|
||||
| 'realestate'
|
||||
| 'food'
|
||||
| 'travel'
|
||||
| 'tech'
|
||||
| 'other';
|
||||
|
||||
export const INDUSTRY_LABELS: Record<Industry, string> = {
|
||||
ecommerce: '电商',
|
||||
education: '教育',
|
||||
gaming: '游戏',
|
||||
medical: '医疗',
|
||||
finance: '金融',
|
||||
realestate: '房产',
|
||||
food: '餐饮',
|
||||
travel: '旅游',
|
||||
tech: '科技',
|
||||
other: '其他',
|
||||
};
|
||||
|
||||
export interface Project {
|
||||
id: string;
|
||||
name: string;
|
||||
industry: Industry;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type AspectRatio = '16:9' | '9:16' | '1:1' | '4:3';
|
||||
export type Resolution = '720p' | '1080p' | '4K';
|
||||
|
||||
export type GenerationStatus =
|
||||
| 'optimizing'
|
||||
| 'prompt_optimized'
|
||||
| 'generating'
|
||||
| 'completed'
|
||||
| 'failed';
|
||||
|
||||
export interface GenerationRecord {
|
||||
id: string;
|
||||
projectId: string;
|
||||
projectName: string;
|
||||
originalPrompt: string;
|
||||
optimizedPrompt: string;
|
||||
duration: number;
|
||||
aspectRatio: AspectRatio;
|
||||
resolution: Resolution;
|
||||
status: GenerationStatus;
|
||||
videoUrl?: string;
|
||||
creditsCost: number;
|
||||
createdAt: string;
|
||||
generatedAt?: string;
|
||||
}
|
||||
|
||||
export interface GenerationParams {
|
||||
prompt: string;
|
||||
duration: number;
|
||||
aspectRatio: AspectRatio;
|
||||
resolution: Resolution;
|
||||
}
|
||||
|
||||
export interface OptimizeResult {
|
||||
optimizedPrompt: string;
|
||||
creditsCost: number;
|
||||
}
|
||||
|
||||
export interface LoginParams {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
// ── Admin Types ──────────────────────────────────────
|
||||
|
||||
export interface AdminUser {
|
||||
id: string;
|
||||
username: string;
|
||||
email: string;
|
||||
phone?: string;
|
||||
credits: number;
|
||||
isActive: boolean;
|
||||
isAdmin: boolean;
|
||||
userType: string;
|
||||
createdAt: string;
|
||||
lastLoginAt?: string;
|
||||
allowedMenus?: string[] | null;
|
||||
}
|
||||
|
||||
export interface AdminStats {
|
||||
totalUsers: number;
|
||||
totalProjects: number;
|
||||
totalGenerations: number;
|
||||
totalRevenue: number;
|
||||
creditsConsumedToday: number;
|
||||
}
|
||||
|
||||
export interface ModelConfig {
|
||||
id: string;
|
||||
name: string;
|
||||
provider: string;
|
||||
apiBase: string;
|
||||
apiKey: string;
|
||||
modelName: string;
|
||||
weight: number;
|
||||
maxTokens: number;
|
||||
temperature: number;
|
||||
isActive: boolean;
|
||||
priority: number;
|
||||
}
|
||||
|
||||
export interface SystemConfig {
|
||||
id: string;
|
||||
key: string;
|
||||
value: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface AdminNotification {
|
||||
id: string;
|
||||
title: string;
|
||||
content: string;
|
||||
type: string;
|
||||
isRead: boolean;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface AdminGenerationRecord {
|
||||
id: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
projectId: string;
|
||||
projectName: string;
|
||||
originalPrompt: string;
|
||||
optimizedPrompt: string;
|
||||
duration?: number;
|
||||
aspectRatio?: string;
|
||||
resolution?: string;
|
||||
status: 'prompt_optimized' | 'generating' | 'completed' | 'failed';
|
||||
videoUrl?: string;
|
||||
references?: { url: string; type: string; name: string }[];
|
||||
creditsCost: number;
|
||||
textCreditsCost: number;
|
||||
textTokensUsed: number;
|
||||
videoTokensUsed: number;
|
||||
errorMessage?: string;
|
||||
createdAt: string;
|
||||
generatedAt?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user