import { GET, POST, DELETE, PUT } from './request'; import type { ModelSchema } from '@/types/mongoSchema'; import type { ModelUpdateParams } from '@/types/model'; import { RequestPaging } from '../types/index'; import type { ModelListResponse } from './response/model'; /** * 获取模型列表 */ export const getMyModels = () => GET('/model/list'); /** * 创建一个模型 */ export const postCreateModel = (data: { name: string }) => POST('/model/create', data); /** * 根据 ID 删除模型 */ export const delModelById = (id: string) => DELETE(`/model/del?modelId=${id}`); /** * 根据 ID 获取模型 */ export const getModelById = (id: string) => GET(`/model/detail?modelId=${id}`); /** * 根据 ID 更新模型 */ export const putModelById = (id: string, data: ModelUpdateParams) => PUT(`/model/update?modelId=${id}`, data); /* 共享市场 */ /** * 获取共享市场模型 */ export const getShareModelList = (data: { searchText?: string } & RequestPaging) => POST(`/model/share/getModels`, data); /** * 收藏/取消收藏模型 */ export const triggerModelCollection = (modelId: string) => POST(`/model/share/collection?modelId=${modelId}`);