Skip to content

Commit

Permalink
Release (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
asp345 authored Oct 22, 2024
1 parent b6c3e96 commit 1f97567
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions core/src/main/kotlin/common/util/SugangSnuUrlUtils.kt
Original file line number Diff line number Diff line change
@@ -4,6 +4,14 @@ import com.wafflestudio.snu4t.common.enum.Semester
import org.springframework.web.util.DefaultUriBuilderFactory

object SugangSnuUrlUtils {
val redirectPrefixUrl =
DefaultUriBuilderFactory().builder()
.scheme("http")
.host("libproxy.snu.ac.kr")
.path("/_Lib_Proxy_Url/")
.build()
.toString()

fun convertSemesterToSugangSnuSearchString(semester: Semester): String =
when (semester) {
Semester.SPRING -> "U000200001U000300001"
@@ -18,18 +26,19 @@ object SugangSnuUrlUtils {
courseNumber: String,
lectureNumber: String,
): String =
DefaultUriBuilderFactory().builder()
.scheme("http")
.host("sugang.snu.ac.kr")
.path("/sugang/cc/cc103.action")
.queryParam("openSchyy", year)
.queryParam("openShtmFg", makeOpenShtmFg(semester))
.queryParam("openDetaShtmFg", makeOpenDetaShtmFg(semester))
.queryParam("sbjtCd", courseNumber)
.queryParam("ltNo", lectureNumber)
.queryParam("sbjtSubhCd", "000")
.build()
.toString()
redirectPrefixUrl +
DefaultUriBuilderFactory().builder()
.scheme("https")
.host("sugang.snu.ac.kr")
.path("/sugang/cc/cc103.action")
.queryParam("openSchyy", year)
.queryParam("openShtmFg", makeOpenShtmFg(semester))
.queryParam("openDetaShtmFg", makeOpenDetaShtmFg(semester))
.queryParam("sbjtCd", courseNumber)
.queryParam("ltNo", lectureNumber)
.queryParam("sbjtSubhCd", "000")
.build()
.toString()

private fun makeOpenShtmFg(semester: Semester) =
when (semester) {

0 comments on commit 1f97567

Please sign in to comment.