import type { AxiosResponse } from 'axios' import { apiHttp as http } from '@/utils/http' import type { RestDataDetail } from './type' /** * 根据id 加载Rest数据 * @param id Rest接口ID */ export const getRestDataApi = async (id: string): Promise> => { return http.get({ url: `/dataset/rest/${id}/` }) } /** * 获取Rest数据列表 */ export const getRestDataListApi = async (): Promise> => { return http.get({ url: '/dataset/rest' }) } /** * 更新Rest数据 * @param id Rest数据id * @param data Rest数据 */ export const updateRestDataApi = async ( id: string, data: Partial> ): Promise> => { return http.put({ url: `/dataset/rest/${id}/`, data: data }) } /** * 创建Rest数据 * @param data Rest数据 */ export const createRestDataApi = async ( data: Omit ): Promise> => { return http.post({ url: '/dataset/rest/', data: data }) } /** * 删除Rest数据 * @param id Rest接口ID */ export const deleteRestDataApi = async (id: string): Promise> => { return http.delete({ url: `/dataset/rest/${id}/` }) }