Merge pull request #118 from TeamBNBN/be/Lecture

feat: Lecture 강의 상세보기시 강의 시간 조회 추가
This commit is contained in:
yulmam 2024-07-26 12:52:29 +09:00 committed by GitHub
commit 955444022f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 22 additions and 9 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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)