Skip to content

Commit

Permalink
docs: swagger에서 [POST] /group 파라미터 이쁘게 (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
w8385 authored Apr 23, 2024
1 parent 13788ab commit 04aab43
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
46 changes: 23 additions & 23 deletions src/group/dto/create-group.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ export class CreateGroupDto {
})
readonly description: string;

@ApiProperty({
required: false,
description: '부모임장 사용자의 ObjectId와 권한',
example: [
{
user: '60f4b3b3b3b3b3b3b3b3b3',
authorities: ['subManager'],
},
],
})
readonly subManagers: [
{
user: string;
authorities: string[];
},
];

@ApiProperty({
required: false,
description: '모임원 사용자의 ObjectId',
example: ['60f4b3b3b3b3b3b3b3b3b3'],
})
readonly members: string[];
// @ApiProperty({
// required: false,
// description: '부모임장 사용자의 ObjectId와 권한',
// example: [
// {
// user: '60f4b3b3b3b3b3b3b3b3b3',
// authorities: ['subManager'],
// },
// ],
// })
// readonly subManagers: [
// {
// user: string;
// authorities: string[];
// },
// ];
//
// @ApiProperty({
// required: false,
// description: '모임원 사용자의 ObjectId',
// example: ['60f4b3b3b3b3b3b3b3b3b3'],
// })
// readonly members: string[] | null;
}
13 changes: 13 additions & 0 deletions src/group/dto/upload-group.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';

import { CreateGroupDto } from './create-group.dto';

export class UploadGroupDto extends CreateGroupDto {
@ApiProperty({
required: false,
description: '모임 회원 명단 엑셀 파일',
type: 'file',
format: 'binary',
})
readonly memberExcel: Express.Multer.File | undefined;
}
3 changes: 2 additions & 1 deletion src/group/group.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { UpdateMemberDto } from '../member/dto/update-member.dto';
import { Member } from '../member/member.decorators';
import { CreateGroupDto } from './dto/create-group.dto';
import { UpdateGroupDto } from './dto/update-group.dto';
import { UploadGroupDto } from './dto/upload-group.dto';
import { Group } from './group.decorators';
import { GroupService } from './group.service';

Expand All @@ -36,7 +37,7 @@ export class GroupController {
description: '모임을 생성합니다.',
})
@ApiFile('memberExcel')
@ApiBody({ type: CreateGroupDto })
@ApiBody({ type: UploadGroupDto })
create(
@Body() createGroupDto: CreateGroupDto,
@UploadedFile() memberExcel: Express.Multer.File,
Expand Down

0 comments on commit 04aab43

Please sign in to comment.