From e2940329b65267d336e4612fccf98efccb43f931 Mon Sep 17 00:00:00 2001 From: xiaojue Date: Wed, 10 Jan 2024 14:59:30 +0800 Subject: [PATCH] feature:swagger doc support --- src/plugins/router.ts | 11 +++++------ src/typings/daruk_options.d.ts | 3 ++- tslint.json | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/router.ts b/src/plugins/router.ts index 021ce7a..ebce01f 100644 --- a/src/plugins/router.ts +++ b/src/plugins/router.ts @@ -3,18 +3,17 @@ * @date 2020-01-15 * @fileoverview 重构router部分,使用依赖控制controller */ -import Router = require('@koa/router'); -import swaggerJsdoc from 'swagger-jsdoc'; import assert = require('assert'); import { Container } from 'inversify'; -import is = require('is'); -import Koa = require('koa'); -import { koaSwagger } from 'koa2-swagger-ui'; -import urljoin = require('url-join'); import Daruk from '../core/daruk'; import { darukContainer } from '../core/inversify.config'; +import { koaSwagger } from 'koa2-swagger-ui'; import { TYPES } from '../core/types'; import { plugin } from '../decorators'; +import is = require('is'); +import Router = require('@koa/router'); +import swaggerJsdoc from 'swagger-jsdoc'; +import urljoin = require('url-join'); import { CONTROLLER_CLASS, CONTROLLER_CLASS_PREFIX, diff --git a/src/typings/daruk_options.d.ts b/src/typings/daruk_options.d.ts index 8778851..7d75765 100644 --- a/src/typings/daruk_options.d.ts +++ b/src/typings/daruk_options.d.ts @@ -25,10 +25,11 @@ export interface Options { middlewareOrder: string[]; name: string; rootPath: string; + routerOptions:any; debug: boolean; bodyOptions: koaBody.IKoaBodyOptions; exitHook: boolean; - + swagger:any; // monitor: { // enable: boolean; // v8AnalyticsPath: string; diff --git a/tslint.json b/tslint.json index 3b23315..c20287f 100644 --- a/tslint.json +++ b/tslint.json @@ -8,6 +8,7 @@ "eofline": false, "indent": [true, "spaces", 2], "no-empty-interface": false, + "ordered-imports": false, "jsdoc-format": false, "no-redundant-jsdoc": false, "unified-signatures": false