1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| import { Get, Provide, Query } from '@midwayjs/decorator';
| import { CoolController, BaseController } from '@cool-midway/core';
| import { CreateApiDoc } from '@midwayjs/swagger';
|
| /**
| * swagger
| */
| @Provide()
| @CoolController(null, {
| tagName: 'swagger 文档',
| description: 'swagger 文档演示',
| })
| export class DemoSwaggerController extends BaseController {
| @CreateApiDoc()
| .summary('hello 接口')
| .description('hello 接口功能描述')
| .param('姓名')
| .build()
| @Get('/hello')
| async hello(@Query() name: string) {
| return this.ok(`你好:${name}!!`);
| }
| }
|
|