add route module
This commit is contained in:
parent
1057041738
commit
c74757d692
34
src/modules/restful/types.ts
Normal file
34
src/modules/restful/types.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { Type } from '@nestjs/common';
|
||||||
|
import { ExternalDocumentationObject } from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
||||||
|
|
||||||
|
export interface TagOption {
|
||||||
|
name: string;
|
||||||
|
description?: string;
|
||||||
|
externalDocs?: ExternalDocumentationObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ApiDocSource {
|
||||||
|
title?: string;
|
||||||
|
description?: string;
|
||||||
|
auth?: boolean;
|
||||||
|
tags?: (string | TagOption)[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ApiConfig extends ApiDocSource {
|
||||||
|
docuri?: string;
|
||||||
|
default: string;
|
||||||
|
enable: string;
|
||||||
|
versions: Record<string, VersionOption>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VersionOption extends ApiDocSource {
|
||||||
|
routes?: RouteOption[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RouteOption {
|
||||||
|
name: string;
|
||||||
|
path: string;
|
||||||
|
controllers: Type<any>[];
|
||||||
|
children?: RouteOption[];
|
||||||
|
doc?: ApiDocSource;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user