diff --git a/src/app/modules/demo/controller/app/swagger.ts b/src/app/modules/demo/controller/app/swagger.ts index 0f58766..f4a469a 100644 --- a/src/app/modules/demo/controller/app/swagger.ts +++ b/src/app/modules/demo/controller/app/swagger.ts @@ -14,10 +14,16 @@ export class DemoSwaggerController extends BaseController { @CreateApiDoc() .summary('hello 接口') .description('hello 接口功能描述') - .param('姓名') + .param('姓名', { required: true }) + .param('年龄', { required: true }) + .param('简介', { required: false }) .build() @Get('/hello') - async hello(@Query() name: string) { - return this.ok(`你好:${name}!!`); + async hello( + @Query() name: string, + @Query() age: number, + @Query() desc: string + ) { + return this.ok(`你好:${name}!! ${age} ${desc}`); } }