Skip to content

Commit

Permalink
[Feat] : 스터디 게시글 단건조회에 isClose반환
Browse files Browse the repository at this point in the history
  • Loading branch information
wellbeing-dough committed Jan 31, 2024
1 parent 0ba1a13 commit 6fadf33
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ public class PostData {
private final boolean isUsersPost;
private final boolean isBookmarked;
private final Long studyId;
private final boolean isClose;
private final UserData postedUser;

@Builder
public PostData(Long postId, String title, LocalDateTime createdDate, String content, MajorType major, int studyPerson, GenderType filteredGender, StudyWayType studyWay, int penalty, String penaltyWay, LocalDate studyStartDate, LocalDate studyEndDate, String charUrl, int remainingSeat, boolean isUsersPost, boolean isBookmarked, Long studyId, UserData postedUser) {
public PostData(Long postId, String title, LocalDateTime createdDate, String content, MajorType major, int studyPerson, GenderType filteredGender, StudyWayType studyWay, int penalty, String penaltyWay, LocalDate studyStartDate, LocalDate studyEndDate, String charUrl, int remainingSeat, boolean isUsersPost, boolean isBookmarked, Long studyId, boolean isClose, UserData postedUser) {
this.postId = postId;
this.title = title;
this.createdDate = createdDate;
Expand All @@ -50,6 +51,7 @@ public PostData(Long postId, String title, LocalDateTime createdDate, String con
this.isUsersPost = isUsersPost;
this.isBookmarked = isBookmarked;
this.studyId = studyId;
this.isClose = isClose;
this.postedUser = postedUser;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class FindPostResponseById {
private final boolean isUsersPost;
private final boolean isBookmarked;
private final Long studyId;
private final boolean isClose;
private final boolean isApply;
private final UserData postedUser;
private final List<PostDataByMajor> relatedPost;
Expand All @@ -53,6 +54,7 @@ public FindPostResponseById(PostData postData, List<PostDataByMajor> relatedPost
this.isUsersPost = postData.isUsersPost();
this.isBookmarked = postData.isBookmarked();
this.studyId = postData.getStudyId();
this.isClose = postData.isClose();
this.postedUser = postData.getPostedUser();
this.relatedPost = relatedPosts;
this.isApply = isApply;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public Optional<PostData> findPostById(Long postId, Long userId) {
post.studyStartDate, post.studyEndDate, post.chatUrl, post.remainingSeat,
userId != null ? Expressions.booleanTemplate("{0} = {1}", post.postedUserId, userId) : Expressions.constant(false),
userId != null ? Expressions.booleanTemplate("{0} = {1}", bookmark.userId, userId) : Expressions.constant(false),
post.studyId,
post.studyId, post.close.as("isClose"),
Projections.constructor(
UserData.class,
user.id, user.major, user.nickname, user.imageUrl
Expand Down

0 comments on commit 6fadf33

Please sign in to comment.