Skip to content

Commit

Permalink
[Fix] : 게시글 생성, 수정 시 close 여부가 반영되지않는 문제 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
elyudwo committed Jan 28, 2024
1 parent ba0f90f commit 5b6b579
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class StudyPostEntity extends BaseTimeEntity {
private Long studyId;

@Builder
public StudyPostEntity(Long id, String title, String content, String chatUrl, MajorType major, int studyPerson, GenderType filteredGender, StudyWayType studyWay, int penalty, String penaltyWay, LocalDate studyStartDate, LocalDate studyEndDate, Long postedUserId, int remainingSeat, Long studyId) {
public StudyPostEntity(Long id, String title, String content, String chatUrl, MajorType major, int studyPerson, GenderType filteredGender, StudyWayType studyWay, int penalty, String penaltyWay, boolean close, LocalDate studyStartDate, LocalDate studyEndDate, Long postedUserId, int remainingSeat, Long studyId) {
this.id = id;
this.title = title;
this.content = content;
Expand All @@ -81,6 +81,7 @@ public StudyPostEntity(Long id, String title, String content, String chatUrl, Ma
this.studyWay = studyWay;
this.penalty = penalty;
this.penaltyWay = penaltyWay;
this.close = close;
this.studyStartDate = studyStartDate;
this.studyEndDate = studyEndDate;
this.postedUserId = postedUserId;
Expand All @@ -98,6 +99,7 @@ public void update(UpdateStudyPostInfo info) {
this.studyWay = info.getStudyWay();
this.penalty = info.getPenalty();
this.penaltyWay = info.getPenaltyWay();
this.close = info.isClose();
this.studyStartDate = info.getStudyStartDate();
this.studyEndDate = info.getStudyEndDate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@

@Getter
public class UpdateStudyPostInfo {
private Long postId;
private Long userId;
private String title;
private String content;
private String chatUrl;
private MajorType major;
private int studyPerson;
private int penalty;
private String penaltyWay;
private GenderType gender;
private StudyWayType studyWay;
private LocalDate studyStartDate;
private LocalDate studyEndDate;
private final Long postId;
private final Long userId;
private final String title;
private final String content;
private final String chatUrl;
private final MajorType major;
private final int studyPerson;
private final int penalty;
private final String penaltyWay;
private final boolean close;
private final GenderType gender;
private final StudyWayType studyWay;
private final LocalDate studyStartDate;
private final LocalDate studyEndDate;

@Builder
public UpdateStudyPostInfo(Long postId, Long userId, String title, String content, String chatUrl, MajorType major, int studyPerson, int penalty, String penaltyWay, GenderType gender, StudyWayType studyWay, LocalDate studyStartDate, LocalDate studyEndDate) {
public UpdateStudyPostInfo(Long postId, Long userId, String title, String content, String chatUrl, MajorType major, int studyPerson, int penalty, String penaltyWay, boolean close, GenderType gender, StudyWayType studyWay, LocalDate studyStartDate, LocalDate studyEndDate) {
this.postId = postId;
this.userId = userId;
this.title = title;
Expand All @@ -35,6 +36,7 @@ public UpdateStudyPostInfo(Long postId, Long userId, String title, String conten
this.studyPerson = studyPerson;
this.penalty = penalty;
this.penaltyWay = penaltyWay;
this.close = close;
this.gender = gender;
this.studyWay = studyWay;
this.studyStartDate = studyStartDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,6 @@ public class CreatePostRequest {
@NotNull(message = "스터디 종료 날짜 작성은 필수입니다!")
private LocalDate studyEndDate;

@Builder
public CreatePostRequest(String title, String content, String chatUrl, MajorType major, int studyPerson, int penalty, String penaltyWay, boolean close, GenderType gender, StudyWayType studyWay, LocalDate studyStartDate, LocalDate studyEndDate) {
this.title = title;
this.content = content;
this.chatUrl = chatUrl;
this.major = major;
this.studyPerson = studyPerson;
this.penalty = penalty;
this.penaltyWay = penaltyWay;
this.close = close;
this.gender = gender;
this.studyWay = studyWay;
this.studyStartDate = studyStartDate;
this.studyEndDate = studyEndDate;
}

public StudyEntity toStudyEntity(Long userId) {
return StudyEntity.builder()
.title(title)
Expand All @@ -112,11 +96,28 @@ public StudyPostEntity toStudyPostEntity(Long userId, Long studyId) {
.studyWay(studyWay)
.penalty(penalty)
.penaltyWay(penaltyWay)
.close(close)
.studyStartDate(studyStartDate)
.studyEndDate(studyEndDate)
.postedUserId(userId)
.remainingSeat(studyPerson)
.studyId(studyId)
.build();
}

@Builder
public CreatePostRequest(String title, String content, String chatUrl, MajorType major, int studyPerson, int penalty, String penaltyWay, boolean close, GenderType gender, StudyWayType studyWay, LocalDate studyStartDate, LocalDate studyEndDate) {
this.title = title;
this.content = content;
this.chatUrl = chatUrl;
this.major = major;
this.studyPerson = studyPerson;
this.penalty = penalty;
this.penaltyWay = penaltyWay;
this.close = close;
this.gender = gender;
this.studyWay = studyWay;
this.studyStartDate = studyStartDate;
this.studyEndDate = studyEndDate;
}
}

0 comments on commit 5b6b579

Please sign in to comment.