Skip to content

Commit

Permalink
Merge pull request #99 from wafflestudio/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
Hank-Choi authored Jan 6, 2024
2 parents 37413d4 + 519ae7d commit 4b5bb52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 27 deletions.
1 change: 1 addition & 0 deletions api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ server:
buffered: false
suffix:
file-date-format:
max-http-request-header-size: 100KB

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile
import org.springframework.data.domain.Sort
import org.springframework.data.mongodb.core.MongoTemplate
import org.springframework.data.mongodb.core.findOne
import org.springframework.data.mongodb.core.query.Criteria
import org.springframework.data.mongodb.core.query.Query
import org.springframework.data.mongodb.core.query.isEqualTo
Expand Down Expand Up @@ -50,20 +51,16 @@ class SnuttLectureSyncJobConfig(

@Bean
fun syncJobNextSemester(jobRepository: JobRepository): Job {
val (currentYear, currentSemester) = semesterUtils.getCurrentYearAndSemester()
val (yearOfNextSemester, nextSemester) = semesterUtils.getYearAndSemesterOfNextSemester()
val (targetYear, targetSemester) = when (
snuttSemesterLectureRepository.existsByYearAndSemester(
yearOfNextSemester,
nextSemester.value,
)
) {
true -> yearOfNextSemester to nextSemester
false -> currentYear to currentSemester
val coursebook = mongoTemplate.findOne<Map<String, String>>(
Query().with(Sort.by(Sort.Direction.DESC, "year").and(Sort.by(Sort.Direction.DESC, "semester"))),
"coursebooks",
)
val (targetYear, targetSemester) = coursebook!!.let {
it["year"]!!.toInt() to it["semester"]!!.toInt()
}
lecturesMap = lectureRepository.findAll().associateBy { "${it.courseNumber},${it.instructor}" }.toMutableMap()
semesterLecturesMap =
semesterLectureRepository.findAllByYearAndSemesterWithLecture(targetYear, targetSemester.value)
semesterLectureRepository.findAllByYearAndSemesterWithLecture(targetYear, targetSemester)
.associateBy { "${it.lecture.courseNumber},${it.lecture.instructor},${it.year},${it.semester}" }
.toMutableMap()

Expand All @@ -74,7 +71,7 @@ class SnuttLectureSyncJobConfig(
Query.query(
Criteria
.where("year").isEqualTo(targetYear)
.and("semester").isEqualTo(targetSemester.value),
.and("semester").isEqualTo(targetSemester),
),
),
)
Expand Down
24 changes: 9 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import org.springframework.boot.gradle.tasks.bundling.BootJar
import java.io.ByteArrayOutputStream

plugins {
id("org.springframework.boot") version "3.0.6"
id("io.spring.dependency-management") version "1.1.0"
kotlin("jvm") version "1.8.21"
id("org.springframework.boot") version "3.1.4" apply false
id("io.spring.dependency-management") version "1.1.3"
kotlin("jvm") version "1.9.10"
kotlin("plugin.spring") version "1.8.21"
kotlin("plugin.allopen") version "1.8.21"
kotlin("plugin.noarg") version "1.8.21"
Expand Down Expand Up @@ -75,15 +75,15 @@ subprojects {
}

project(":api") {
tasks.bootJar {
archiveFileName.set("snuttev-api.jar")
}
val bootJar: BootJar by tasks

bootJar.archiveFileName.set("snuttev-api.jar")
}

project(":batch") {
tasks.bootJar {
archiveFileName.set("snuttev-batch.jar")
}
val bootJar: BootJar by tasks

bootJar.archiveFileName.set("snuttev-batch.jar")
}

project(":core") {
Expand All @@ -94,12 +94,6 @@ project(":core") {
bootJar.enabled = false
}

val jar: Jar by tasks
val bootJar: BootJar by tasks

jar.enabled = true
bootJar.enabled = false

fun RepositoryHandler.mavenCodeArtifact() {
maven {
val authToken = properties["codeArtifactAuthToken"] as String? ?: ByteArrayOutputStream().use {
Expand Down

0 comments on commit 4b5bb52

Please sign in to comment.