-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/113 커뮤니티 게시글, 댓글 조회 페이징 처리 #119
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 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7a5c027
test(community): 게시글, 댓글 Fixture 생성
ayoung-dev 7d0e75c
refactor(community): DTO 이름 및 변수명 변경
ayoung-dev 8abf87b
test(community): 수정된 변수명 반영 및 조회 테스트 페이징으로 변경
ayoung-dev 474558f
reafactor(community): 커뮤니티 게시글 조회 페이징 처리
ayoung-dev 6e046a8
reafactor(community): 커뮤니티 댓글 조회 페이징 처리
ayoung-dev 41e2287
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
ayoung-dev 7a081f8
reafactor(community): 코드 리뷰 사항 반영
ayoung-dev 7893c03
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
ayoung-dev 36d901f
reafactor(community): 코드 리뷰 사항 반영
ayoung-dev db76b87
Merge branch 'main' of https://github.com/prgrms-web-devcourse-final-…
ayoung-dev 64fcb66
chore(community): 불필요한 import 제거
ayoung-dev 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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/somemore/community/dto/response/CommunityBoardDetailResponseDto.java
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,40 @@ | ||
| package com.somemore.community.dto.response; | ||
|
|
||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import com.somemore.community.domain.CommunityBoard; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
|
|
||
| @JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
| @Schema(description = "커뮤니티 게시글 상세 조회 응답 DTO") | ||
| public record CommunityBoardDetailResponseDto( | ||
| @Schema(description = "커뮤니티 게시글 ID", example = "12") | ||
| Long id, | ||
| @Schema(description = "작성자(봉사자) ID", example = "123e4567-e89b-12d3-a456-426614174000") | ||
| UUID writerId, | ||
| @Schema(description = "커뮤니티 게시글 제목", example = "11/29 OO도서관 봉사 같이 갈 사람 모집합니다.") | ||
| String title, | ||
| @Schema(description = "커뮤니티 게시글 내용", example = "저 포함 5명이 같이 가면 좋을 거 같아요") | ||
| String content, | ||
| @Schema(description = "이미지 URL", example = "https://image.domain.com/links") | ||
| String imageUrl, | ||
| @Schema(description = "커뮤니티 게시글 생성 일시", example = "2023-12-02T11:00:00") | ||
| LocalDateTime createdAt, | ||
| @Schema(description = "커뮤니티 게시글 수정 일시", example = "2023-12-02T11:00:00") | ||
| LocalDateTime updatedAt | ||
| ) { | ||
| public static CommunityBoardDetailResponseDto from(CommunityBoard board) { | ||
| return new CommunityBoardDetailResponseDto( | ||
| board.getId(), | ||
| board.getWriterId(), | ||
| board.getTitle(), | ||
| board.getContent(), | ||
| board.getImgUrl(), | ||
| board.getCreatedAt(), | ||
| board.getUpdatedAt() | ||
| ); | ||
| } | ||
| } | ||
31 changes: 0 additions & 31 deletions
31
src/main/java/com/somemore/community/dto/response/CommunityBoardGetDetailResponseDto.java
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
src/main/java/com/somemore/community/dto/response/CommunityBoardGetResponseDto.java
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
src/main/java/com/somemore/community/dto/response/CommunityBoardResponseDto.java
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,31 @@ | ||
| package com.somemore.community.dto.response; | ||
|
|
||
| import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy; | ||
| import com.fasterxml.jackson.databind.annotation.JsonNaming; | ||
| import com.somemore.community.repository.mapper.CommunityBoardView; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| @JsonNaming(SnakeCaseStrategy.class) | ||
| @Schema(description = "커뮤니티 게시글 목록 조회 응답 DTO") | ||
| public record CommunityBoardResponseDto( | ||
| @Schema(description = "커뮤니티 게시글 ID", example = "12") | ||
| Long id, | ||
| @Schema(description = "커뮤니티 게시글 ID", example = "12") | ||
| String title, | ||
| @Schema(description = "작성자(봉사자) ID", example = "123e4567-e89b-12d3-a456-426614174000") | ||
| String writerNickname, | ||
| @Schema(description = "커뮤니티 게시글 생성 일시", example = "2023-12-02T11:00:00") | ||
| LocalDateTime createdAt | ||
| ) { | ||
ayoung-dev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public static CommunityBoardResponseDto from(CommunityBoardView board) { | ||
| return new CommunityBoardResponseDto( | ||
| board.communityBoard().getId(), | ||
| board.communityBoard().getTitle(), | ||
| board.writerNickname(), | ||
| board.communityBoard().getCreatedAt() | ||
| ); | ||
| } | ||
| } | ||
|
|
||
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
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.