Skip to content

Commit

Permalink
Merge pull request #118 from GSM-MSG/117-feature/fix-lecture-list-res…
Browse files Browse the repository at this point in the history
…ponse

강의 리스트 전체 조회 response 요소 추가
  • Loading branch information
ani2689 authored Nov 10, 2023
2 parents 821096d + f470db4 commit 84db914
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,29 @@ import java.util.*
data class LectureResponse(
val id: UUID,
val name: String,
val content: String,
val startDate: LocalDateTime,
val endDate: LocalDateTime,
val completeDate: LocalDateTime,
val lectureType: LectureType,
val lectureStatus: LectureStatus,
val headCount: Int,
val maxRegisteredUser: Int
val maxRegisteredUser: Int,
val lecturer: String
) {
companion object {
fun of(lecture: Lecture, headCount: Int): LectureResponse = LectureResponse(
id = lecture.id,
name = lecture.name,
content = lecture.content,
startDate = lecture.startDate,
endDate = lecture.endDate,
completeDate = lecture.completeDate,
lectureType = lecture.lectureType,
lectureStatus = lecture.getLectureStatus(),
headCount = headCount,
maxRegisteredUser = lecture.maxRegisteredUser
maxRegisteredUser = lecture.maxRegisteredUser,
lecturer = lecture.instructor
)

fun detailOf(lecture: Lecture, headCount: Int): LectureDetailsResponse = LectureDetailsResponse(
Expand All @@ -41,7 +45,7 @@ data class LectureResponse(
lectureStatus = lecture.getLectureStatus(),
headCount = headCount,
maxRegisteredUser = lecture.maxRegisteredUser,
lecturer = lecture.user.name,
lecturer = lecture.instructor,
credit = lecture.credit
)
}
Expand Down

0 comments on commit 84db914

Please sign in to comment.