일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- spring
- CloutNative
- gradle
- offset
- String
- DB생성
- K8S
- SQL
- Lombok
- Seek_Keyset
- MYSQL에러
- Postman
- intellij
- 스프링에러
- NullPointerException
- VUE
- frontend
- 우분투에war배포
- pagination
- MySQL시작하기
- springMVC
- Java
- appleM1
- MySQL
- restful api
- windows10
- SpringBoot
- wappalyzer
- minikube
- 이클립스
- Today
- Total
목록Spring & Spring Boot (24)
미운 오리 새끼의 우아한 개발자되기
현재사이드프로젝트로 Spring Boot 프레임워크를 사용해서 Rest API를 구축하고 있다. 아래와 같이 ReqeustBody로 signInForm이라는 class로 통째로 받으려고 하는데 Body로 보내주는 json은 camelCase이고 signInForm은 snakeCase로 되어있어서 body를 보내줘도 mapping을 못해서 null로 들어오는 상황이 발생했다. UserContoller.java @ApiOperation(value = "sign in with Apple", notes = "Apple Id로 회원가입", produces = "application/json;charset=UTF8") @ApiResponses(value = { @ApiResponse(code = 200, messa..
스프링 부트 테스트 코드 작성 시, JUnit 버전 별로 Annotation이 상이하다. 현재 나는 스프링부트 2.3.3버전을 쓰고 있다. 현재 하고있는 사이드 프로젝트의 Unit 테스트를 위해 JUnit 5.5.2를 Gradle로 디펜던시 추가했다. 테스트 코드에 @RunWith을 버릇처럼 쓰고 있는데 이번에는 import가 되지않아 원인을 찾아보았다. @RunWith(SpringRunner.class) 또는 @RunWith(MockitoJUnitRunner.class) 등은 JUnit version 5 미만 @ExtendWith(SpringExtension.class) 또는 @ExtendWith(MockitoExtension.class) 등 JUnit version 5 일 때 사용한다. 아래의 doc..
Pagination을 할 때 크게 2가지 방법이 있다. 1.Offset 2.Seek/Keyset 'spring boot pagination'을 검색하면 대부분 offset을 이용한 pagination 예시인데 이 방법이 stack over flow에서 'terribly slow' 라고 한다. Seek/keyset 방법을 쓰는게 낫다고 말하는 전문가들이 있다. 나도 아직 사용 전이라 더이상 자세하게 설명은 못하지만 아래 두 글이 도움이 많이 될 것 같아 첨부함. Reference taylorbrazelton.com/posts/2019/03/offset-vs-seek-pagination/ Offset vs Seek/Keyset Pagination Today I was focused on defining th..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/dGIVbX/btqHZkDPs8y/BLkpgFDuCyEDfMO44lHKe1/img.png)
1. Client가 Server에게 요청(Request)을 보내면 Dispatcher Servlet이 이 요청을 가로챔 2. Dispatcher Sevlet은 Handler Mapping에게 어떤 컨트롤러로 이 요청을 보내야 할 지 물어봄 3. 매핑된 메서드가 있는 Controller가 있다면 Handler Mapping이 이를 Dispatcher Servlet에게 넘김 4. 해당 Controller는 해당 요청을 처리할 비즈니스 로직이 담긴 Service를 주입(Dependency Injection) 받아 비즈니스 로직을 Service에게 위임 -> Service가 비즈니스 로직을 처리함(DB접근 등) -> 모든 비즈니스 로직을 끝낸 Service는 결과물을 Controller에게 줌. 5. 결과물을 ..