Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

강의동 Mock Data 추가 #212

Merged
merged 5 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ object SugangSnuClassTimeUtils {
place = locationTexts.joinToString("/"),
startMinute = sugangSnuClassTime.startHour.toInt() * 60 + sugangSnuClassTime.startMinute.toInt(),
endMinute = sugangSnuClassTime.endHour.toInt() * 60 + sugangSnuClassTime.endMinute.toInt(),
lectureHall = null
)
}
.sortedWith(compareBy({ it.day.value }, { it.startMinute }))
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/kotlin/lecturehalls/data/Campus.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.wafflestudio.snu4t.lecturehalls.data

enum class Campus {
GWANAK,
YEONGUN,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeongeon 이 일관될 듯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔫

PYEONGCHANG,
}
6 changes: 6 additions & 0 deletions core/src/main/kotlin/lecturehalls/data/GeoCoordinate.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.wafflestudio.snu4t.lecturehalls.data

class GeoCoordinate(
val lat: Double,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

약어 딴곳에서도 잘 안 쓰니까 안 쓰는 게 좋지 않을까

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lat/lon 말한거지? 바꿨음

val lon: Double
)
28 changes: 28 additions & 0 deletions core/src/main/kotlin/lecturehalls/data/LectureHall.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.wafflestudio.snu4t.lecturehalls.data

import org.springframework.data.annotation.Id
import org.springframework.data.mongodb.core.mapping.Document

@Document
data class LectureHall(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

원어민이 아니라 궁금한 건데 쥐콩만한 강의실도 hall?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요것은 강의실(X) 강의동(O) 입니다. 건물 전체를 말하는거라 Building을 할까 Hall을 할까 하다가 Hall로 했는데 더 나은 것 있으면 추천받아요

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빌딩이 더 낫지않나?

@Id
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금도 lecture 에 강의실 정보 있긴 한데, 따로 document 파는 게 좋은 이유는 머 때문이야?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 우선 Lecture에 종속되는 정보가 아니기도 하고(한 강의동 - 여러 강의)
  • 이 데이터들만 가지고 기능이 새로 나올 수 있다고 생각했기 때문! 건물간 시간 보여준다거나/걔를 이용해서 가까운 강의실 강의 검색하거나 등등 본격적인 지도 기능이 들어가려면 얘가 별도 document로 있는게 낫다고 생각했음

val id: String? = null,

// 동
val buildingNumber: String,

// 건물 이름(한국어) - 자연과학대학(500)
val buildingNameKor: String? = null,

// 건물 이름(영어) - College of Natural Sciences(500)
val buildingNameEng: String? = null,

// 위경도 - 37.4592190840394, 126.948120067187
val locationInDMS: GeoCoordinate,

// 위경도(십진표기) - 488525, 1099948
val locationInDecimal: GeoCoordinate,

// 캠퍼스 - 관악
val campus: Campus,
)
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?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한 dto 안에 snake 랑 섞여있지만 새로 만드는 건 camel 로 하는 게 나으려나…

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엉 섞여있는데 앞으로의 방향성은 camel이라고 해서 우선 일케해쓰

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅇㅇ 이미 얘기 끝났던건데

)

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(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

왜 UUID?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uuid 스펙이랑 다름 ObjectId.get().toHexString() ㄱㄱ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그냥 mock이라서? 아무 스트링이나 넣었음

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
)
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ data class ClassPlaceAndTimeLegacyRequestDto(
day = day,
place = place ?: "",
startMinute = startMinute,
endMinute = endMinute
endMinute = endMinute,
lectureHall = null
)
}

Expand Down
Loading