-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FEAT] 카테고리별 최신 게시물 조회 API 구현 - #434 #447
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2e7faf7
[feat] 카테고리별 최신 게시물 조회 API 구현 (#434)
rlarlgnszx b0bccee
[refactor] 생성자 추가 (#434)
rlarlgnszx 3e0f3d6
Merge branch 'dev' into feat/#434-recentPost
rlarlgnszx 098481e
[fix] ; 추가 (#434)
rlarlgnszx 46df82d
[feat] 포스팅 카테고리 enum 추가 (#434)
rlarlgnszx 8c18846
[refactor] enum으로 변경 (#434)
rlarlgnszx 95a6369
Merge branch 'dev' into feat/#434-recentPost
rlarlgnszx 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 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
17 changes: 17 additions & 0 deletions
17
src/main/java/org/sopt/app/application/playground/dto/PlayGroundPostCategory.java
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,17 @@ | ||
package org.sopt.app.application.playground.dto; | ||
|
||
public enum PlayGroundPostCategory { | ||
SOPT_ACTIVITY("SOPT 활동"), | ||
FREE("자유"), | ||
PART("파트"); | ||
private final String displayName; | ||
|
||
PlayGroundPostCategory(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
} | ||
|
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
29 changes: 29 additions & 0 deletions
29
src/main/java/org/sopt/app/presentation/home/response/RecentPostsResponse.java
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,29 @@ | ||
package org.sopt.app.presentation.home.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import org.sopt.app.application.playground.dto.PlaygroundPostInfo.PlaygroundPostResponse; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class RecentPostsResponse { | ||
private Long id; | ||
private String title; | ||
private String category; | ||
private String content; | ||
private boolean isHotPost; | ||
|
||
public static RecentPostsResponse of(PlaygroundPostResponse playgroundPostResponse) { | ||
return RecentPostsResponse.builder() | ||
.id(playgroundPostResponse.postId()) | ||
.title(playgroundPostResponse.title()) | ||
.category("HOT") | ||
.content(playgroundPostResponse.content()) | ||
.isHotPost(true) | ||
.build(); | ||
Comment on lines
+20
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: 그럼에도 만약 isHotPost를 사용하시는게 맞다 생각하면 이 메서드 명은 of보다는 팩토리 메서드처럼 객체를 만드는 메서드에 이름을 정해주는 것이 혼란을 방지하기에 좋을 것 같아요! |
||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1. primitive type은 Getter로 반환할 때 is라는 접두사가 빠지게 됩니다!
현재에도 반환값이 HotPost로 is 접두사가 빠져있는 것 같아요.
그리고 isHotPost라는 필드가 없더라도 클라이언트가 category로 구분이 가능할 것 같은데 어떻게 생각하시나요?
관련 블로그 글
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 이건 몰랐네요! 좋은 정보 감사합니다!
그러면 hot 쪽을 빼는걸로 할까요 ?
HotPost가 혹시 카테고리별로 작동될수 있다고 생각해서 일단 넣어두긴 했습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hot post가 카테고리 별로 작용될 것 같아서 그런거라면 유지해도 좋을 것 같아요~