Skip to content

Commit

Permalink
fix: WebMvcConfig 합치기
Browse files Browse the repository at this point in the history
  • Loading branch information
softpeanut committed Dec 8, 2022
1 parent 251f2b6 commit 2f06ef4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package team.comit.simtong.global.config

import org.springframework.context.annotation.Configuration
import org.springframework.format.FormatterRegistry
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

/**
*
* Cors 관련 설정을 하는 WebMvcConfig
* WebMvc 관련 설정을 하는 WebMvcConfig
* LocalDateTime, LocalDate, LocalTime 요청값을 ISO-8601으로 설정
*
* @author Chokyunghyeon
* @author kimbeomjin
* @date 2022/12/08
* @version 1.0.0
**/
Expand All @@ -20,4 +24,11 @@ class WebMvcConfig : WebMvcConfigurer {
.allowedMethods("*")
.allowedOriginPatterns("*")
}

override fun addFormatters(registry: FormatterRegistry) {
val registrar = DateTimeFormatterRegistrar().apply {
setUseIsoFormat(true)
}
registrar.registerFormatters(registry)
}
}

0 comments on commit 2f06ef4

Please sign in to comment.