diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/domain/StudyPostEntity.java b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/domain/StudyPostEntity.java index c7014f48..94257dca 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/domain/StudyPostEntity.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/domain/StudyPostEntity.java @@ -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; @@ -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; @@ -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(); } diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/data/UpdateStudyPostInfo.java b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/data/UpdateStudyPostInfo.java index 2a4d9574..8cf6b3c5 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/data/UpdateStudyPostInfo.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/data/UpdateStudyPostInfo.java @@ -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; @@ -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; diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/request/CreatePostRequest.java b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/request/CreatePostRequest.java index 00b119a0..ed658641 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/request/CreatePostRequest.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/studypost/dto/request/CreatePostRequest.java @@ -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) @@ -112,6 +96,7 @@ public StudyPostEntity toStudyPostEntity(Long userId, Long studyId) { .studyWay(studyWay) .penalty(penalty) .penaltyWay(penaltyWay) + .close(close) .studyStartDate(studyStartDate) .studyEndDate(studyEndDate) .postedUserId(userId) @@ -119,4 +104,20 @@ public StudyPostEntity toStudyPostEntity(Long userId, Long studyId) { .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; + } }