-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
774 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/apis/free-posts/free-post-comments/dto/create-free-post-reply-comment.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { FREE_POST_REPLY_COMMENT_DESCRIPTION_LENGTH } from '@src/apis/free-posts/free-post-comments/constants/free-post-comment.constant'; | ||
import { FreePostReplyComment } from '@src/entities/FreePostReplyComment'; | ||
import { IsBoolean, IsOptional, Length } from 'class-validator'; | ||
|
||
export class CreateFreePostReplyCommentDto | ||
implements Pick<FreePostReplyComment, 'description' | 'isAnonymous'> | ||
{ | ||
@ApiProperty({ | ||
description: '본문', | ||
minLength: FREE_POST_REPLY_COMMENT_DESCRIPTION_LENGTH.MIN, | ||
maxLength: FREE_POST_REPLY_COMMENT_DESCRIPTION_LENGTH.MAX, | ||
}) | ||
@Length( | ||
FREE_POST_REPLY_COMMENT_DESCRIPTION_LENGTH.MIN, | ||
FREE_POST_REPLY_COMMENT_DESCRIPTION_LENGTH.MAX, | ||
) | ||
description: string; | ||
|
||
@ApiPropertyOptional({ | ||
description: '익명 여부', | ||
default: false, | ||
}) | ||
@IsOptional() | ||
@IsBoolean() | ||
isAnonymous: boolean = false; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/apis/free-posts/free-post-comments/dto/find-free-post-reply-comment-list-query.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { FREE_POST_ORDER_FIELD } from '@src/apis/free-posts/constants/free-post.constant'; | ||
import { FreePostReplyCommentStatus } from '@src/apis/free-posts/free-post-comments/constants/free-post-comment.enum'; | ||
import { FreePostReplyCommentDto } from '@src/apis/free-posts/free-post-comments/dto/free-post-reply-comment.dto'; | ||
import { SortOrder } from '@src/constants/enum'; | ||
import { PageDto } from '@src/dto/page.dto'; | ||
import { ApiPropertyOrder } from '@src/dto/swagger/api-property-order.decorator'; | ||
import { CsvToOrder, Order } from '@src/dto/transformer/csv-to-order.decorator'; | ||
import { IsDefined, IsOptional } from 'class-validator'; | ||
|
||
export class FindFreePostReplyCommentListQueryDto | ||
extends PageDto | ||
implements Partial<FreePostReplyCommentDto> | ||
{ | ||
@ApiPropertyOrder(FREE_POST_ORDER_FIELD) | ||
@CsvToOrder<typeof FREE_POST_ORDER_FIELD>([...FREE_POST_ORDER_FIELD]) | ||
@IsOptional() | ||
order: Order<typeof FREE_POST_ORDER_FIELD> = { id: SortOrder.Desc }; | ||
|
||
@IsDefined() | ||
status: FreePostReplyCommentStatus = FreePostReplyCommentStatus.Posting; | ||
} |
59 changes: 59 additions & 0 deletions
59
src/apis/free-posts/free-post-comments/dto/free-post-reply-comment.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { FREE_POST_COMMENT_DESCRIPTION_LENGTH } from '@src/apis/free-posts/free-post-comments/constants/free-post-comment.constant'; | ||
import { FreePostReplyCommentStatus } from '@src/apis/free-posts/free-post-comments/constants/free-post-comment.enum'; | ||
import { BaseDto } from '@src/dto/base.dto'; | ||
import { FreePostReplyComment } from '@src/entities/FreePostReplyComment'; | ||
import { Exclude } from 'class-transformer'; | ||
|
||
export class FreePostReplyCommentDto | ||
extends BaseDto | ||
implements | ||
Pick< | ||
FreePostReplyComment, | ||
| 'id' | ||
| 'userId' | ||
| 'freePostCommentId' | ||
| 'description' | ||
| 'isAnonymous' | ||
| 'status' | ||
| 'createdAt' | ||
| 'updatedAt' | ||
| 'deletedAt' | ||
> | ||
{ | ||
@ApiProperty({ | ||
description: '게시글 댓글 고유 ID', | ||
format: 'integer', | ||
}) | ||
freePostCommentId: number; | ||
|
||
@ApiProperty({ | ||
description: '대댓글 작성자 고유 ID', | ||
format: 'integer', | ||
}) | ||
userId: number; | ||
|
||
@ApiProperty({ | ||
description: '본문', | ||
minLength: FREE_POST_COMMENT_DESCRIPTION_LENGTH.MIN, | ||
maxLength: FREE_POST_COMMENT_DESCRIPTION_LENGTH.MAX, | ||
}) | ||
description: string; | ||
|
||
@ApiProperty({ | ||
description: '익명 여부', | ||
}) | ||
isAnonymous: boolean; | ||
|
||
@Exclude() | ||
status: FreePostReplyCommentStatus; | ||
|
||
@Exclude() | ||
deletedAt: Date; | ||
|
||
constructor(freePostDto: Partial<FreePostReplyCommentDto> = {}) { | ||
super(); | ||
|
||
Object.assign(this, freePostDto); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/apis/free-posts/free-post-comments/dto/free-post-reply-comments-item.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { FreePostReplyCommentDto } from '@src/apis/free-posts/free-post-comments/dto/free-post-reply-comment.dto'; | ||
|
||
export class FreePostReplyCommentsItemDto extends FreePostReplyCommentDto {} |
Oops, something went wrong.