1
0

feat: 前端集成 Prettier 代码格式化

This commit is contained in:
2026-04-24 13:40:53 +08:00
parent 52007c9461
commit 365943e4c4
61 changed files with 1968 additions and 1698 deletions

View File

@@ -1,84 +1,80 @@
export interface Provider {
id: string;
name: string;
apiKey: string;
baseUrl: string;
protocol: 'openai' | 'anthropic';
enabled: boolean;
createdAt: string;
updatedAt: string;
id: string
name: string
apiKey: string
baseUrl: string
protocol: 'openai' | 'anthropic'
enabled: boolean
createdAt: string
updatedAt: string
}
export interface Model {
id: string;
providerId: string;
modelName: string;
enabled: boolean;
createdAt: string;
unifiedId?: string;
id: string
providerId: string
modelName: string
enabled: boolean
createdAt: string
unifiedId?: string
}
export interface UsageStats {
id: number;
providerId: string;
modelName: string;
requestCount: number;
date: string;
id: number
providerId: string
modelName: string
requestCount: number
date: string
}
export interface CreateProviderInput {
id: string;
name: string;
apiKey: string;
baseUrl: string;
protocol: 'openai' | 'anthropic';
enabled: boolean;
id: string
name: string
apiKey: string
baseUrl: string
protocol: 'openai' | 'anthropic'
enabled: boolean
}
export interface UpdateProviderInput {
name?: string;
apiKey?: string;
baseUrl?: string;
protocol?: 'openai' | 'anthropic';
enabled?: boolean;
name?: string
apiKey?: string
baseUrl?: string
protocol?: 'openai' | 'anthropic'
enabled?: boolean
}
export interface CreateModelInput {
providerId: string;
modelName: string;
enabled: boolean;
providerId: string
modelName: string
enabled: boolean
}
export interface UpdateModelInput {
providerId?: string;
modelName?: string;
enabled?: boolean;
providerId?: string
modelName?: string
enabled?: boolean
}
export interface StatsQueryParams {
providerId?: string;
modelName?: string;
startDate?: string;
endDate?: string;
providerId?: string
modelName?: string
startDate?: string
endDate?: string
}
export class ApiError extends Error {
status: number;
code?: string;
status: number
code?: string
constructor(
status: number,
message: string,
code?: string,
) {
super(message);
this.name = 'ApiError';
this.status = status;
this.code = code;
constructor(status: number, message: string, code?: string) {
super(message)
this.name = 'ApiError'
this.status = status
this.code = code
}
}
export interface ApiErrorResponse {
error: string;
code?: string;
error: string
code?: string
}