본문 바로가기

Spring/boot10

spring boot localDateTime parsing rest api request localDateTime parsing rest api 를 통해 들어온 request param 의 localDateTime type 을 파싱 controller 의 /test url 을 통해 request 가 json 타입으로 들어오면 파싱 가능public class SampleIO { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime dateTime; @RequestMapping(value = "/test", method = RequestMethod.POST) public ResponseEntity testParsing(@RequestBody SampleIO sampleIO) { xxx xxx .. 2020. 9. 11.
spring-boot Controller Mock Testcase 작성 spring boot controller test (mock 버전) java source import org.example.online.domain.SampleIO; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; @RestController public class SampleController { @Request.. 2020. 9. 5.
spring boot logback 파일 appender 특정 파일 로그 위치에 로그가 쌓이지 않는 현상 spring boot logback 파일 appender 특정 위치에 로그가 쌓이지 않는 현상 spring boot logback 을 아래와 같이 설정했는데 해당 위치에 로그가 안떨어짐. 아래와 같이 설정했다고 했을 때. shell 에서 다음과 같이 설정해줘야 함. LOG_DIR=xxx/xxx/xxx LOG_NAME=test export LOG_DIR export LOG_NAME ${LOG_DIR}/${LOG_NAME}.log %d{yyyy-MM-dd HH:mm:ss} [%-5p] [%F]%M\(%L\) : %m%n ${LOG_DIR}/${LOG_NAME}.log.%d{yyyy-MM-dd} 2020. 9. 3.
spring boot 에서 yml 파일을 읽어서 map object 를 만드는 것 (map 형태) spring boot 에서 yml 파일을 읽어서 map object 를 만드는 것 정리 (map 형태) 아래 TEST1, TEST2 를 맵 객체에 담기. 2020. 7. 10.