chore: openapi doc generator (#2644)

* chore: extract the type and comment from apis

* chore: template code

* feat: openapi

* pref: openapi generator. send into public/openapi folder
This commit is contained in:
Finley Ge
2024-09-09 15:43:09 +08:00
committed by GitHub
parent 5f3c8e9046
commit 78ad2791cd
12 changed files with 2214 additions and 24 deletions

File diff suppressed because one or more lines are too long

View File

@@ -4,13 +4,25 @@ import { ManagePermissionVal } from '@fastgpt/global/support/permission/constant
import type { ApiRequestProps } from '@fastgpt/service/type/next';
import { NextAPI } from '@/service/middleware/entry';
import { OutLinkSchema } from '@fastgpt/global/support/outLink/type';
export type OutLinkListQuery = {
appId: string;
type: string;
export const ApiMetadata = {
name: '获取应用内所有 Outlink',
author: 'Finley',
version: '0.1.0'
};
// Outlink
export type OutLinkListQuery = {
appId: string; // 应用 ID
type: string; // 类型
};
export type OutLinkListBody = {};
// 响应: 应用内全部 Outlink
export type OutLinkListResponse = OutLinkSchema[];
// 查询应用内全部 Outlink
async function handler(
req: ApiRequestProps<OutLinkListBody, OutLinkListQuery>
): Promise<OutLinkListResponse> {