feat(image): 新建 knowai-core:1.0.0 镜像并完成推送
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
- 搭建 api、auth、utils 等逻辑模块 - 通过 tsc、eslint、vitest 测试验证 BREAKING CHANGE: 新镜像分支
This commit is contained in:
29
api/modules/model.ts
Normal file
29
api/modules/model.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { AxiosRequestConfig } from 'axios';
|
||||
import type { ApiClient } from '../types';
|
||||
import type {
|
||||
GetAIPlazaRequest,
|
||||
GetAIPlazaResponse,
|
||||
GetModelDetailRequest,
|
||||
GetModelDetailResponse,
|
||||
GetModelCommentsRequest,
|
||||
GetModelCommentsResponse
|
||||
} from '@/types/model/api';
|
||||
|
||||
// AI模型API服务工厂函数
|
||||
export const modelApi = (client: ApiClient) => ({
|
||||
// 获取AI模型广场数据
|
||||
getAIPlaza: (params?: GetAIPlazaRequest): Promise<GetAIPlazaResponse> => {
|
||||
const config: AxiosRequestConfig = params ? { params } : {};
|
||||
return client.get('/models/plaza', config);
|
||||
},
|
||||
|
||||
// 获取模型详情
|
||||
getModelDetail: ({ modelId, ...params }: GetModelDetailRequest): Promise<GetModelDetailResponse> => {
|
||||
return client.get(`/models/${modelId}`, { params });
|
||||
},
|
||||
|
||||
// 获取模型评论
|
||||
getModelComments: ({ modelId, ...params }: GetModelCommentsRequest): Promise<GetModelCommentsResponse> => {
|
||||
return client.get(`/models/${modelId}/comments`, { params });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user