Skip to content

Commit

Permalink
Merge pull request #203 from wafflestudio/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Hank-Choi authored Jan 5, 2024
2 parents 66277ac + fe6e6c8 commit a617bed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ data class SugangSnuLectureInfo(

data class SugangSnuLectureSubInfo(
@JsonProperty("sbjtNm")
val sbjtNm: String? = null,
val courseName: String? = null,
@JsonProperty("sbjtSubhNm")
val courseSubName: String? = null,
@JsonProperty("profNm")
val professorName: String? = null,
@JsonProperty("departmentKorNm")
val departmentKorNm: String? = null,
@JsonProperty("deptKorNm")
Expand Down Expand Up @@ -110,8 +114,6 @@ data class SugangSnuLectureSubInfo(
// val openPnt: Int? = null,
// @JsonProperty("mrksRelevalYn")
// val mrksRelevalYn: String? = null,
// @JsonProperty("sbjtSubhNm")
// val sbjtSubhNm: String? = null,
// @JsonProperty("theoryLtTmCnt")
// val theoryLtTmCnt: Int? = null,
// @JsonProperty("cptnCorsFgNm")
Expand Down Expand Up @@ -150,8 +152,6 @@ data class SugangSnuLectureSubInfo(
// val ltNo: String? = null,
// @JsonProperty("lsnProgLangEng")
// val lsnProgLangEng: String? = null,
// @JsonProperty("profNm")
// val profNm: String? = null,
// @JsonProperty("sbjtSubhCd")
// val sbjtSubhCd: String? = null,
// @JsonProperty("sbjtFldEngNm")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,23 @@ class SugangSnuFetchServiceImpl(
}.map { lecture ->
val extraLectureInfo =
sugangSnuRepository.getLectureInfo(year, semester, lecture.courseNumber, lecture.lectureNumber)
val extraCourseTitle =
if (extraLectureInfo.subInfo.courseSubName.isNullOrEmpty()) extraLectureInfo.subInfo.courseName
else "${extraLectureInfo.subInfo.courseName} (${extraLectureInfo.subInfo.courseSubName})"
val extraDepartment =
if (extraLectureInfo.subInfo.departmentKorNm != null && extraLectureInfo.subInfo.majorKorNm != null)
"${extraLectureInfo.subInfo.departmentKorNm}(${extraLectureInfo.subInfo.majorKorNm})"
else null

lecture.apply {
classPlaceAndTimes = SugangSnuClassTimeUtils.convertTextToClassTimeObject(
extraLectureInfo.ltTime,
extraLectureInfo.ltRoom
)
courseTitle = extraCourseTitle ?: courseTitle
instructor = extraLectureInfo.subInfo.professorName ?: instructor
category = extraLectureInfo.subInfo.sbjtFldNm ?: category
if (extraLectureInfo.subInfo.departmentKorNm != null && extraLectureInfo.subInfo.majorKorNm != null) {
department = "${extraLectureInfo.subInfo.departmentKorNm}(${extraLectureInfo.subInfo.majorKorNm})"
}
department = extraDepartment ?: department
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class LectureCustomRepositoryImpl(
searchCondition.courseNumber?.takeIf { it.isNotEmpty() }?.let { Lecture::courseNumber inValues it },
searchCondition.classification?.takeIf { it.isNotEmpty() }?.let { Lecture::classification inValues it },
searchCondition.category?.takeIf { it.isNotEmpty() }?.let { Lecture::category inValues it },
searchCondition.department?.takeIf { it.isNotEmpty() }
?.let { departments -> Lecture::department regex departments.joinToString("|") { Regex.escape(it) } },
searchCondition.department?.takeIf { it.isNotEmpty() }?.let { Lecture::department inValues it },
searchCondition.times?.takeIf { it.isNotEmpty() }?.let { searchTimes ->
Criteria().andOperator(
Lecture::classPlaceAndTimes ne listOf(),
Expand Down

0 comments on commit a617bed

Please sign in to comment.