0.0.2 • Published 2 years ago

midwayjs-kinfe4j2 v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

midwayjs swagger knife4j2

Example

访问地址: {host}/swagger-ui/index.html

示例图

Thanks to @nestjs/swagger

Usage

// configuration.ts
import * as swagger from 'midwayjs-knife4j2';

...

@Configuration({
  imports: [
    {
      component: swagger,
      enabledEnvironment: ['local', 'dev'],
    }
  ]
})
...

// xxx.controller.ts
import { ApiResponse } from 'midwayjs-knife4j2';

...
@Get('/overview')
@ApiResponse({
  status: 200,
  description: '控制台',
  type: WorkbenchDto,
})
async getOverview(): Promise<WorkbenchDto> {
  return this.workbenchService.getData();
}
...

this is a sub package for midway.

Document: https://midwayjs.org/docs/extensions/swagger

License

MIT