diff --git a/src/main/kotlin/com/example/onui/domain/timeline/presentation/TimelineController.kt b/src/main/kotlin/com/example/onui/domain/timeline/presentation/TimelineController.kt index 2613ea0..4313475 100644 --- a/src/main/kotlin/com/example/onui/domain/timeline/presentation/TimelineController.kt +++ b/src/main/kotlin/com/example/onui/domain/timeline/presentation/TimelineController.kt @@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.* import java.time.LocalDate import java.time.format.DateTimeParseException import java.util.* +import javax.validation.constraints.Min +import javax.validation.constraints.NotBlank +import javax.validation.constraints.NotNull @Validated @RestController @@ -22,9 +25,9 @@ class TimelineController( @GetMapping fun getByDate( - @RequestParam("idx", required = true) idx: Int = 0, - @RequestParam("size", required = true) size: Int = 5, - @RequestParam("date", required = true) date: String + @RequestParam("idx", required = true) @NotNull idx: Int = 0, + @RequestParam("size", required = true) @NotNull @Min(1) size: Int = 5, + @RequestParam("date", required = true) @NotBlank date: String ) = try { timelineService.searchByDate(idx, size, LocalDate.parse(date)) } catch (e: DateTimeParseException) { diff --git a/src/main/kotlin/com/example/onui/global/config/querydsl/QuerydslConfig.kt b/src/main/kotlin/com/example/onui/global/config/querydsl/QuerydslConfig.kt index 0e20321..8bc532c 100644 --- a/src/main/kotlin/com/example/onui/global/config/querydsl/QuerydslConfig.kt +++ b/src/main/kotlin/com/example/onui/global/config/querydsl/QuerydslConfig.kt @@ -1,10 +1,8 @@ package com.example.onui.global.config.querydsl import com.querydsl.jpa.impl.JPAQueryFactory - import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration - import javax.persistence.EntityManager import javax.persistence.PersistenceContext diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e345ed7..6262cb8 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -34,8 +34,8 @@ spring: properties: hibernate: format_sql: false - show_sql: true - use_sql_comments: false + show_sql: false + use_sql_comments: true open-in-view: false # server