From c4373a24af38750ca7a31904ab2d7ccd63341227 Mon Sep 17 00:00:00 2001 From: kgc9007 Date: Fri, 26 Jul 2024 12:51:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Lecture=20=EA=B0=95=EC=9D=98=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=EB=B3=B4=EA=B8=B0=EC=8B=9C=20=EA=B0=95?= =?UTF-8?q?=EC=9D=98=20=EC=8B=9C=EA=B0=84=20=EC=A1=B0=ED=9A=8C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edufocus/edufocus/lecture/entity/Lecture.java | 10 +++++++--- .../lecture/entity/LectureCreateRequest.java | 4 +++- .../lecture/entity/LectureDetailResponse.java | 4 +++- .../lecture/service/LectureServiceImpl.java | 13 +++++++++---- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/Lecture.java b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/Lecture.java index 24adc42..0a9168a 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/Lecture.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/Lecture.java @@ -15,7 +15,8 @@ import java.util.Date; @AllArgsConstructor public class Lecture { - @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) @Column private Long id; @@ -29,6 +30,9 @@ public class Lecture { @Lob private String description; + @Lob + private String plan; + @Column private String image; @@ -40,8 +44,8 @@ public class Lecture { @Temporal(TemporalType.DATE) private Date endDate; - @Lob - private String plan; + @Column + private String time; @Column private boolean online; diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java index d76afbe..dfd02fd 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureCreateRequest.java @@ -15,10 +15,12 @@ public class LectureCreateRequest { private String description; + private String plan; + private Date startDate; private Date endDate; - private String plan; + private String time; } diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureDetailResponse.java b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureDetailResponse.java index 9c14a49..0a5629a 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureDetailResponse.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/entity/LectureDetailResponse.java @@ -21,13 +21,15 @@ public class LectureDetailResponse { private String description; + private String plan; + private String image; private Date startDate; private Date endDate; - private String plan; + private String time; private boolean online; diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java index 73267b9..52a8824 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java @@ -43,9 +43,10 @@ public class LectureServiceImpl implements LectureService { .user(user) .title(lectureCreateRequest.getTitle()) .description(lectureCreateRequest.getDescription()) + .plan(lectureCreateRequest.getPlan()) .startDate(lectureCreateRequest.getStartDate()) .endDate(lectureCreateRequest.getEndDate()) - .plan(lectureCreateRequest.getPlan()) + .time(lectureCreateRequest.getTime()) .build(); if (image != null && !image.isEmpty()) { @@ -81,14 +82,17 @@ public class LectureServiceImpl implements LectureService { if (lectureCreateRequest.getDescription() != null) { lecture.setDescription(lectureCreateRequest.getDescription()); } + if (lectureCreateRequest.getPlan() != null) { + lecture.setPlan(lectureCreateRequest.getPlan()); + } if (lectureCreateRequest.getStartDate() != null) { lecture.setStartDate(lectureCreateRequest.getStartDate()); } if (lectureCreateRequest.getEndDate() != null) { lecture.setEndDate(lectureCreateRequest.getEndDate()); } - if (lectureCreateRequest.getPlan() != null) { - lecture.setPlan(lectureCreateRequest.getPlan()); + if (lectureCreateRequest.getTime() != null) { + lecture.setTime(lectureCreateRequest.getTime()); } lectureRepository.save(lecture); @@ -167,10 +171,11 @@ public class LectureServiceImpl implements LectureService { .id(lecture.get().getId()) .title(lecture.get().getTitle()) .description(lecture.get().getDescription()) + .plan(lecture.get().getPlan()) .image(lecture.get().getImage()) .startDate(lecture.get().getStartDate()) .endDate(lecture.get().getEndDate()) - .plan(lecture.get().getPlan()) + .time(lecture.get().getTime()) .online(lecture.get().isOnline()) .teacherName(lecture.get().getUser().getName()) .status(userStatus)