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)