REST API를 운영하는 것이 목적이며 REST 조건 중 CRUD Operation을 그에 따른 HTTP 전송 방식에 맞추는 것 목표
@ComponentScan
없이 진행했는데 갑자기 무리없이 실행되었다save
함수를 호출할 때@RequestBody
VS @RequestParam
@RequestBody
이용해 name이라는 String type으로 DB에 추가하려했기 때문에 문제 발생@RequestBody
: Client의 request(요청)들을 객체 형태로 받음@RequestParam
: Client의 request(요청)들을 변수에 할당해 받음@ResponseBody
: @RequestBody
와 반대 상황으로 인지하면 된다@RequestBody
, @RequestParam
, @ModelAttribute
간단하게 본다면
@RequestParam
: 변수 정의해 request 받음@RequestBody
: 객체로 request 받음, 기본 생성자만으로 역직렬화 가능, setter 없어도 getter로만 가능@ModelAttribute
: 객체로 request 받음, @RequestBody
와는 다르게 setter 필요@RequestBody
의 경우는 변환이었다)@PathVariable
?@RequestParma
을 이용했던 경우@PathVariable
이용한 경우Spring Data JPA에서는 객체 생성 시 Reflection API를 활용하는데 이 때 DB 값을 객체 필드에 주입할 때 기본 생성자로 객체를 생성한 후 Reflection API를 사용하여 값을 매핑하기 때문에 기본 생성자가 필요하다
checkout -b branch
로 branch를 만들고 add
, commit
등의 작업까지는 local branch에서 작업을 하는 것이라 생각하면 된다git branch
라는 명령어를 통해 local에는 branch가 남아있다는 것을 확인할 수 있었다 master
에 위치해야만 branch를 삭제할 수 있으며 default branch의 경우는 삭제할 수 없다는 것을 알 수 있었다@RequestBody
: https://cheershennah.tistory.com/179@RequestParmas
: https://hongku.tistory.com/119@RequestBody
, @RequestParmas
, @ModelAndView
: https://parkadd.tistory.com/70@ModelAndView
vs @RequestBody
1: https://tecoble.techcourse.co.kr/post/2021-05-11-requestbody-modelattribute/@ModelAndView
vs @RequestBody
2: https://maivve.tistory.com/298@PathVariable
: https://byul91oh.tistory.com/435