mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-03-23 14:02:37 +00:00
集成swagger
This commit is contained in:
parent
dab5fa0c87
commit
e0e86cdf6b
@ -14,10 +14,16 @@ export class DemoSwaggerController extends BaseController {
|
|||||||
@CreateApiDoc()
|
@CreateApiDoc()
|
||||||
.summary('hello 接口')
|
.summary('hello 接口')
|
||||||
.description('hello 接口功能描述')
|
.description('hello 接口功能描述')
|
||||||
.param('姓名')
|
.param('姓名', { required: true })
|
||||||
|
.param('年龄', { required: true })
|
||||||
|
.param('简介', { required: false })
|
||||||
.build()
|
.build()
|
||||||
@Get('/hello')
|
@Get('/hello')
|
||||||
async hello(@Query() name: string) {
|
async hello(
|
||||||
return this.ok(`你好:${name}!!`);
|
@Query() name: string,
|
||||||
|
@Query() age: number,
|
||||||
|
@Query() desc: string
|
||||||
|
) {
|
||||||
|
return this.ok(`你好:${name}!! ${age} ${desc}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user