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,24 +1,19 @@
import type { Model, CreateModelInput, UpdateModelInput } from '@/types';
import { request } from './client';
import type { Model, CreateModelInput, UpdateModelInput } from '@/types'
import { request } from './client'
export async function listModels(providerId?: string): Promise<Model[]> {
const path = providerId
? `/api/models?provider_id=${encodeURIComponent(providerId)}`
: '/api/models';
return request<Model[]>('GET', path);
const path = providerId ? `/api/models?provider_id=${encodeURIComponent(providerId)}` : '/api/models'
return request<Model[]>('GET', path)
}
export async function createModel(input: CreateModelInput): Promise<Model> {
return request<Model>('POST', '/api/models', input);
return request<Model>('POST', '/api/models', input)
}
export async function updateModel(
id: string,
input: UpdateModelInput,
): Promise<Model> {
return request<Model>('PUT', `/api/models/${id}`, input);
export async function updateModel(id: string, input: UpdateModelInput): Promise<Model> {
return request<Model>('PUT', `/api/models/${id}`, input)
}
export async function deleteModel(id: string): Promise<void> {
return request<void>('DELETE', `/api/models/${id}`);
return request<void>('DELETE', `/api/models/${id}`)
}