diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 11f81c5a..e9d2a891 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -3,7 +3,7 @@ reverse_proxy host.docker.internal:3000 @backend_denied { - path /swagger-ui/* /api-docs/* + path /swagger-ui/* /api-docs/* /api/v1/search/refresh not remote_ip {$LOCAL_IP} } abort @backend_denied @@ -16,8 +16,4 @@ # Login reverse_proxy /oauth2/authorization/idsnucse host.docker.internal:8080 - - # Swagger - reverse_proxy /swagger-ui/* host.docker.internal:8080 - reverse_proxy /api-docs/* host.docker.internal:8080 } diff --git a/docker-compose-backend.yml b/docker-compose-backend.yml index f8469c0d..f0ed034e 100644 --- a/docker-compose-backend.yml +++ b/docker-compose-backend.yml @@ -6,12 +6,14 @@ services: volumes: - ./cse-files:/app/cse-files - ./files:/app/files + - ./logs:/app/logs environment: SPRING_DATASOURCE_URL: "jdbc:mysql://host.docker.internal:3306/${MYSQL_DATABASE}?serverTimezone=Asia/Seoul&useSSL=false&allowPublicKeyRetrieval=true" SPRING_DATASOURCE_USERNAME: ${MYSQL_USER} SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD} OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET} + OIDC_CLIENT_SECRET_DEV: ${OIDC_CLIENT_SECRET_DEV} URL: ${URL} SLACK_TOKEN: ${SLACK_TOKEN} SLACK_CHANNEL: ${SLACK_CHANNEL} diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/academics/dto/GeneralStudiesRequirementsPageResponse.kt b/src/main/kotlin/com/wafflestudio/csereal/core/academics/dto/GeneralStudiesRequirementsPageResponse.kt index 0851527d..f76e2e42 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/academics/dto/GeneralStudiesRequirementsPageResponse.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/academics/dto/GeneralStudiesRequirementsPageResponse.kt @@ -4,18 +4,15 @@ import com.wafflestudio.csereal.core.academics.database.AcademicsEntity class GeneralStudiesRequirementsPageResponse( val overview: String, - val subjectChanges: String, val generalStudies: List ) { companion object { fun of( overview: AcademicsEntity, - subjectChanges: AcademicsEntity, generalStudies: List ): GeneralStudiesRequirementsPageResponse { return GeneralStudiesRequirementsPageResponse( overview = overview.description, - subjectChanges = subjectChanges.description, generalStudies = generalStudies.map { GeneralStudiesDto.of(it) } ) } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/academics/service/AcademicsService.kt b/src/main/kotlin/com/wafflestudio/csereal/core/academics/service/AcademicsService.kt index 6874f169..c734d5c3 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/academics/service/AcademicsService.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/academics/service/AcademicsService.kt @@ -26,6 +26,7 @@ interface AcademicsService { studentType: String, postType: String ): List + fun readGeneralStudiesRequirements(language: String): GeneralStudiesRequirementsPageResponse fun readDegreeRequirements(language: String): DegreeRequirementsPageResponse fun createCourse( @@ -33,12 +34,14 @@ interface AcademicsService { request: CourseDto, attachments: List? ): CourseDto + fun readAllCourses(language: String, studentType: String): List fun readCourse(language: String, name: String): CourseDto fun createScholarshipDetail( studentType: String, request: ScholarshipDto ): ScholarshipDto + fun readAllScholarship(language: String, studentType: String): ScholarshipPageResponse fun readScholarship(scholarshipId: Long): ScholarshipDto fun migrateAcademicsDetail( @@ -46,11 +49,13 @@ interface AcademicsService { postType: String, requestList: List ): List + fun migrateCourses(studentType: String, requestList: List): List fun migrateScholarshipDetail( studentType: String, requestList: List ): List + fun migrateAcademicsDetailAttachments( academicsId: Long, attachments: List? @@ -149,19 +154,13 @@ class AcademicsServiceImpl( AcademicsPostType.GENERAL_STUDIES_REQUIREMENTS, null ) - val subjectChanges = - academicsRepository.findByLanguageAndStudentTypeAndPostType( - enumLanguageType, - AcademicsStudentType.UNDERGRADUATE, - AcademicsPostType.GENERAL_STUDIES_REQUIREMENTS_SUBJECT_CHANGES - ) val generalStudiesEntity = academicsRepository.findAllByLanguageAndStudentTypeAndPostTypeOrderByYearDesc( enumLanguageType, AcademicsStudentType.UNDERGRADUATE, AcademicsPostType.GENERAL_STUDIES_REQUIREMENTS ).filter { academicsEntity -> academicsEntity.year != null } - return GeneralStudiesRequirementsPageResponse.of(overview, subjectChanges, generalStudiesEntity) + return GeneralStudiesRequirementsPageResponse.of(overview, generalStudiesEntity) } @Transactional(readOnly = true) diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/reservation/api/ReservationController.kt b/src/main/kotlin/com/wafflestudio/csereal/core/reservation/api/ReservationController.kt index e053955c..12264c60 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/reservation/api/ReservationController.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/reservation/api/ReservationController.kt @@ -48,7 +48,7 @@ class ReservationController( @RequestParam month: Int, @RequestParam day: Int ): ResponseEntity> { - val start = LocalDateTime.of(year, month, day, 0, 0) + val start = LocalDateTime.of(year, month, day, 0, 0).minusHours(9) val end = start.plusDays(7) return ResponseEntity.ok(reservationService.getRoomReservationsBetween(roomId, start, end)) } diff --git a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt index 978ebb19..12211f0d 100644 --- a/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt +++ b/src/main/kotlin/com/wafflestudio/csereal/core/seminar/database/SeminarRepository.kt @@ -20,6 +20,7 @@ interface SeminarRepository : JpaRepository, CustomSeminarR fun findFirstByIsDeletedFalseAndIsPrivateFalseAndCreatedAtLessThanOrderByCreatedAtDesc( timestamp: LocalDateTime ): SeminarEntity? + fun findFirstByIsDeletedFalseAndIsPrivateFalseAndCreatedAtGreaterThanOrderByCreatedAtAsc( timestamp: LocalDateTime ): SeminarEntity? @@ -92,8 +93,9 @@ class SeminarRepositoryImpl( val seminarEntityList = when { sortBy == ContentSearchSortType.DATE || keyword.isNullOrEmpty() -> seminarEntityQuery.orderBy( - seminarEntity.createdAt.desc() + seminarEntity.startDate.desc() ) + else /* sortBy == RELEVANCE */ -> seminarEntityQuery }.fetch() diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 4a40f3e2..835e2c45 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -7,8 +7,9 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver hikari: - maximum-pool-size: 24 + maximum-pool-size: 65 jpa: + show-sql: true properties: hibernate: dialect: com.wafflestudio.csereal.common.config.MySQLDialectCustom @@ -21,7 +22,7 @@ spring: server: tomcat: threads: - max: 16 + max: 32 servlet: session: timeout: 7200 # 2시간 @@ -47,6 +48,19 @@ endpoint: login-page: http://localhost:8080 + +logging: + level: + org: + springframework: + security: DEBUG + web: + servlet: DEBUG + +customlog: + file: + name: "csereal-backend" + --- spring: config.activate.on-profile: local @@ -57,7 +71,6 @@ spring: jpa: hibernate: ddl-auto: update - show-sql: true open-in-view: false security: oauth2: @@ -74,12 +87,9 @@ spring: issuer-uri: https://id.snucse.org/o jwk-set-uri: https://id.snucse.org/o/jwks -logging: - level: - # default: INFO - org: - springframework: - security: DEBUG +customlog: + file: + base: "./logs" --- spring: @@ -120,13 +130,16 @@ slack: token: ${SLACK_TOKEN} channel: ${SLACK_CHANNEL} +customlog: + file: + base: "/app/logs" + --- spring: config.activate.on-profile: dev jpa: hibernate: ddl-auto: update - show-sql: true open-in-view: false security: oauth2: @@ -156,6 +169,9 @@ endpoint: login-page: https://${URL} +customlog: + file: + base: "./logs" --- spring: config.activate.on-profile: test @@ -167,7 +183,6 @@ spring: jpa: database: h2 database-platform: org.hibernate.dialect.H2Dialect - show-sql: true open-in-view: false hibernate: ddl-auto: create-drop @@ -177,11 +192,6 @@ spring: h2: console: enabled: true - -logging: - level: - # default: INFO - org: - springframework: - security: DEBUG - +customlog: + file: + base: "./logs" diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index d7d3352b..cb4d3e48 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -11,11 +11,10 @@ + - - @@ -36,6 +35,30 @@ + + + + + + ${LOG_FILE_BASE}/${LOG_FILE_NAME}.log + + ${FILE_LOG_PATTERN} + ${FILE_LOG_CHARSET} + + + ${LOG_FILE_BASE}/${LOG_FILE_NAME}_%d{yyyy-MM-dd}.log + false + 30 + + + + + + 5000 + + + + @@ -45,6 +68,7 @@ + @@ -52,6 +76,7 @@ +