This commit is contained in:
Archer
2023-11-09 09:46:57 +08:00
committed by GitHub
parent 661ee79943
commit 8bb5588305
402 changed files with 9899 additions and 5967 deletions

View File

@@ -1,26 +1,26 @@
import { GET, POST, DELETE } from '@/web/common/api/request';
import type { EditApiKeyProps, GetApiKeyProps } from '@/global/support/api/openapiReq.d';
import { GET, POST, DELETE, PUT } from '@/web/common/api/request';
import type { EditApiKeyProps, GetApiKeyProps } from '@/global/support/openapi/api.d';
import type { OpenApiSchema } from '@fastgpt/global/support/openapi/type';
/**
* crete a api key
*/
export const createAOpenApiKey = (data: EditApiKeyProps) =>
POST<string>('/support/openapi/postKey', data);
POST<string>('/support/openapi/create', data);
/**
* update a api key
*/
export const putOpenApiKey = (data: EditApiKeyProps & { _id: string }) =>
POST<string>('/support/openapi/putKey', data);
PUT<string>('/support/openapi/update', data);
/**
* get api keys
*/
export const getOpenApiKeys = (params?: GetApiKeyProps) =>
GET<OpenApiSchema[]>('/support/openapi/getKeys', params);
GET<OpenApiSchema[]>('/support/openapi/list', params);
/**
* delete api by id
*/
export const delOpenApiById = (id: string) => DELETE(`/support/openapi/delKey?id=${id}`);
export const delOpenApiById = (id: string) => DELETE(`/support/openapi/delete`, { id });