Skip to content

Commit

Permalink
FIX: Presentation Status에 Dummy 타입 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
saewoo1 committed Oct 29, 2024
1 parent 45ab06d commit d2857ff
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,24 @@ public class Presentation {
private User user;

protected Presentation(Category category, LocalDateTime dateTime,
PresentationTime presentationTime, String subject, String summary, String detail) {
PresentationTime presentationTime, String subject, String summary, String detail,
PresentationStatus status) {
this.category = category;
this.dateTime = dateTime;
this.presentationTime = presentationTime;
this.subject = subject;
this.detail = detail;
this.summary = summary;
this.presentationStatus = PresentationStatus.EXPECTED;
this.presentationStatus = status;
this.presentationLocation = PresentationLocation.BASEMENT;
}

public static Presentation of(Category category, LocalDateTime dateTime,
PresentationTime presentationTime, String subject, String summary, String detail) {
PresentationTime presentationTime, String subject, String summary, String detail,
PresentationStatus status) {

return new Presentation(category, dateTime, presentationTime, subject, summary, detail);
return new Presentation(category, dateTime, presentationTime, subject, summary, detail,
status);
}

public void adminUpdate(PresentationStatus newStatus, LocalDateTime newDateTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,14 @@ public void updatePresentationByFormId(Long formId, PresentationUpdateDto dto) {

// 발표 취소 시 해당 날짜에 더미 폼 생성
if (dto.getStatus() == PresentationStatus.CANCEL) {
Presentation presentation = Presentation.of(Category.DUMMY, dto.getDateTime(),
PresentationTime.HALF, "dummy", "dummy", "dummy");
Presentation presentation =
Presentation.of(Category.DUMMY,
dto.getDateTime(),
PresentationTime.HALF,
"dummy",
"dummy",
"dummy",
PresentationStatus.DUMMY);
presentationRepository.save(presentation);
}

Expand Down Expand Up @@ -239,17 +245,15 @@ public PresentationMyPagePaginationDto getUserPresentations(Long userId, Pageabl
public void generatePresentationFormsEveryThreeMonth(LocalDate nowDate) {
List<LocalDateTime> wednesdays = getDummyPresentationFormsDate(nowDate);
List<Presentation> presentations = wednesdays.stream()
.map(wednesday -> {
Presentation presentation = Presentation.of(
Category.DUMMY,
wednesday,
PresentationTime.HALF,
"dummy",
"dummy",
"dummy"
);
return presentation;
})
.map(wednesday -> Presentation.of(
Category.DUMMY,
wednesday,
PresentationTime.HALF,
"dummy",
"dummy",
"dummy",
PresentationStatus.DUMMY
))
.collect(Collectors.toList());

presentationRepository.saveAll(presentations);
Expand Down

0 comments on commit d2857ff

Please sign in to comment.