Skip to content

Commit 583eadf

Browse files
committed
fix: query decorator
1 parent 02055bc commit 583eadf

12 files changed

Lines changed: 2504 additions & 1079 deletions

openapi.json

Lines changed: 2491 additions & 1051 deletions
Large diffs are not rendered by default.

src/auth/auth.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export class AuthController {
101101

102102
@ApiOperation({ operationId: 'getAuthorizer' })
103103
@Get('authorizer')
104-
getAuthorizer(@Query('GetAuthorizerQuery') query: GetAuthorizerQuery): Authorizer {
104+
getAuthorizer(@Query() query: GetAuthorizerQuery): Authorizer {
105105
const {
106106
provider,
107107
redirectUri: redirect_uri,

src/captcha/captcha.controller.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ export class CaptchaController {
6262
type: [Captcha],
6363
})
6464
@Get()
65-
async list(
66-
@Query('ListCaptchasQuery') query: ListCaptchasQuery,
67-
@Res() res: Response
68-
): Promise<CaptchaDocument[]> {
65+
async list(@Query() query: ListCaptchasQuery, @Res() res: Response): Promise<CaptchaDocument[]> {
6966
const count = await this.captchaService.count(query);
7067
const data = await this.captchaService.list(query);
7168
res.set({ 'X-Total-Count': count.toString() }).json(data);

src/common/decorator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
22

33
export function ApiStringOrArray(description: string, required: boolean = false) {
44
return ApiProperty({
5+
type: 'string',
56
oneOf: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }],
67
description,
78
required,

src/email/email-record.controller.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ export class EmailRecordController {
6060
type: [EmailRecord],
6161
})
6262
@Get()
63-
async list(
64-
@Req() req: Request,
65-
@Query('ListEmailRecordsQuery') query: ListEmailRecordsQuery,
66-
@Res() res: Response
67-
) {
63+
async list(@Req() req: Request, @Query() query: ListEmailRecordsQuery, @Res() res: Response) {
6864
const count = await this.emailRecordService.count(query);
6965
const data = await this.emailRecordService.list(query);
7066
res.set({ 'X-Total-Count': count.toString() }).json(data);

src/group/group.controller.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ export class GroupController {
7474
type: [Group],
7575
})
7676
@Get()
77-
async list(
78-
@Query('ListGroupsQuery') query: ListGroupsQuery,
79-
@Res() res: Response
80-
): Promise<GroupDocument[]> {
77+
async list(@Query() query: ListGroupsQuery, @Res() res: Response): Promise<GroupDocument[]> {
8178
const count = await this.groupService.count(query);
8279
const data = await this.groupService.list(query);
8380
res.set({ 'X-Total-Count': count.toString() }).json(data);

src/industry/industry.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class IndustryController {
1919
type: [Industry],
2020
})
2121
@Get()
22-
list(@Query('ListIndustriesQuery') query: ListIndustriesQuery) {
22+
list(@Query() query: ListIndustriesQuery) {
2323
return this.industryService.list(query);
2424
}
2525
}

src/namespace/namespace.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class NamespaceController {
9898
})
9999
@Get()
100100
async list(
101-
@Query('ListNamespacesQuery') query: ListNamespacesQuery,
101+
@Query() query: ListNamespacesQuery,
102102
@Res() res: Response
103103
): Promise<NamespaceDocument[]> {
104104
const count = await this.namespaceService.count(query);

src/session/session.controller.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ export class SessionController {
6262
type: [Session],
6363
})
6464
@Get()
65-
async list(
66-
@Query('ListSessionsQuery') query: ListSessionsQuery,
67-
@Res() res: Response
68-
): Promise<Session[]> {
65+
async list(@Query() query: ListSessionsQuery, @Res() res: Response): Promise<Session[]> {
6966
const count = await this.sessionService.count(query);
7067
const data = await this.sessionService.list(query);
7168
res.set({ 'X-Total-Count': count.toString() }).json(data);

src/sms/sms-record.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class SmsRecordController {
5959
type: [SmsRecord],
6060
})
6161
@Get()
62-
async list(@Query('ListSmsRecordsQuery') query: ListSmsRecordsQuery, @Res() res: Response) {
62+
async list(@Query() query: ListSmsRecordsQuery, @Res() res: Response) {
6363
const count = await this.smsRecordService.count(query);
6464
const data = await this.smsRecordService.list(query);
6565
res.set({ 'X-Total-Count': count.toString() }).json(data);

0 commit comments

Comments
 (0)