-
Notifications
You must be signed in to change notification settings - Fork 4
♻️ refactor: API Response, Request DTO 구현, ApiProperty 추가 #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
49c24ab
♻️ refactor: 컨트롤러 리팩토링 http 응답코드 추가
Jo-Minseok b118572
♻️ refactor: feed Service Feed Module exports에 추가
Jo-Minseok 1035523
♻️ refactor: response DTO 적용 및 Request DTO 수정, Swagger 추가
Jo-Minseok 844f995
✅ test: dto 수정에 따른 테스트 코드 수정
Jo-Minseok 3716a28
♻️ refactor: response DTO 사용으로 변경
Jo-Minseok 9db455d
♻️ refactor: response DTO 사용하도록 변경
Jo-Minseok 19c81fb
Merge branch 'main' into refactor/api
Jo-Minseok a59aa2a
🧼 clean: 필요없는 멤버 변수 제거 및 스펠링 수정
Jo-Minseok 59734dc
Merge branch 'main' into refactor/api
Jo-Minseok 87ef839
♻️ refactor: dto example 추가
Jo-Minseok ef1b9c3
✨ feat: 파일 추가 API DTO 디렉토리 위치 수정 및 example 추가
Jo-Minseok 8895c4b
✨ feat: 파일 삭제 API DTO 추가
Jo-Minseok 358287a
♻️ refactor: 파일 추가 API Response DTO 사용, ApiResponse 사용하도록 변경
Jo-Minseok fa71d6a
🧼 clean: http code 추가
Jo-Minseok 3eb7607
♻️ refactor: 댓글 업데이트 find 2번 수행 -\> 1번 수행 변경
Jo-Minseok 09054d0
🐛 fix: 테스트 응답 문자열 변경
Jo-Minseok b832ccc
🐛 fix: docker init 데이터와 동일하게 수정
Jo-Minseok 548aa28
Merge branch 'main' into refactor/api
Jo-Minseok d0f76d8
🐛 fix: validate 추가 및 멘트 수정
Jo-Minseok 8b579c1
🐛 fix: 멘트 수정
Jo-Minseok File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,57 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Comment } from '../../entity/comment.entity'; | ||
|
||
export class GetCommentResponseDto { | ||
@ApiProperty({ | ||
example: 1, | ||
description: '댓글 ID', | ||
}) | ||
id: number; | ||
|
||
@ApiProperty({ | ||
example: 'example content', | ||
description: '댓글 내용', | ||
}) | ||
comment: string; | ||
|
||
@ApiProperty({ | ||
example: '2025-01-01T00:00:00.000Z', | ||
description: '댓글 작성 날짜', | ||
}) | ||
date: Date; | ||
|
||
@ApiProperty({ | ||
example: { | ||
id: 1, | ||
userName: 'example', | ||
profileImage: 'https://example.com', | ||
}, | ||
description: '댓글 작성자 정보', | ||
}) | ||
user: { | ||
id: number; | ||
userName: string; | ||
profileImage: string; | ||
}; | ||
|
||
private constructor(partial: Partial<GetCommentResponseDto>) { | ||
Object.assign(this, partial); | ||
} | ||
|
||
static toResponseDto(comment: Comment) { | ||
new GetCommentResponseDto({ | ||
id: comment.id, | ||
comment: comment.comment, | ||
date: comment.date, | ||
user: { | ||
id: comment.user.id, | ||
userName: comment.user.userName, | ||
profileImage: comment.user.profileImage, | ||
}, | ||
}); | ||
} | ||
|
||
static toResponseDtoArray(comments: Comment[]) { | ||
return comments.map(this.toResponseDto); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.