Skip to content

Commit

Permalink
강의동 Mock 데이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
subeenpark-io committed Jan 10, 2024
1 parent be99793 commit 14f799d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/main/kotlin/lectures/data/ClassPlaceAndTime.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.wafflestudio.snu4t.lectures.data

import com.wafflestudio.snu4t.common.enum.DayOfWeek
import com.wafflestudio.snu4t.lecturehalls.data.LectureHall

data class ClassPlaceAndTime(
val day: DayOfWeek,
val place: String,
val startMinute: Int,
val endMinute: Int,
var lectureHall: LectureHall?
)
16 changes: 16 additions & 0 deletions core/src/main/kotlin/lectures/dto/ClassPlaceAndTimeDto.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ package com.wafflestudio.snu4t.lectures.dto

import com.fasterxml.jackson.annotation.JsonProperty
import com.wafflestudio.snu4t.common.enum.DayOfWeek
import com.wafflestudio.snu4t.lecturehalls.data.Campus
import com.wafflestudio.snu4t.lecturehalls.data.GeoCoordinate
import com.wafflestudio.snu4t.lecturehalls.data.LectureHall
import com.wafflestudio.snu4t.lectures.data.ClassPlaceAndTime
import com.wafflestudio.snu4t.lectures.utils.endPeriod
import com.wafflestudio.snu4t.lectures.utils.minuteToString
import com.wafflestudio.snu4t.lectures.utils.startPeriod
import java.util.UUID

data class ClassPlaceAndTimeDto(
val day: DayOfWeek,
Expand Down Expand Up @@ -34,6 +38,7 @@ data class ClassPlaceAndTimeLegacyDto(
val periodLength: Double,
@JsonProperty("start")
val startPeriod: Double,
val lectureHall: LectureHall?
)

fun ClassPlaceAndTimeLegacyDto(classPlaceAndTime: ClassPlaceAndTime): ClassPlaceAndTimeLegacyDto = ClassPlaceAndTimeLegacyDto(
Expand All @@ -45,4 +50,15 @@ fun ClassPlaceAndTimeLegacyDto(classPlaceAndTime: ClassPlaceAndTime): ClassPlace
endTime = minuteToString(classPlaceAndTime.endMinute),
startPeriod = classPlaceAndTime.startPeriod,
periodLength = classPlaceAndTime.endPeriod - classPlaceAndTime.startPeriod,
lectureHall = MockLectureHall()
)

private fun MockLectureHall() = LectureHall(
id = UUID.randomUUID().toString(),
buildingNumber = "500",
buildingNameKor = "자연과학대학(500)",
buildingNameEng = "College of Natural Sciences(500)",
locationInDMS = GeoCoordinate(37.4592190840394, 126.94812006718699),
locationInDecimal = GeoCoordinate(488525.0, 1099948.0),
campus = Campus.GWANAK
)

0 comments on commit 14f799d

Please sign in to comment.