phoneNumber - getter & setter & toString 설정
@JsonProperty("phone_number")
@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class)
→ post method
@PutMapping("/put")
public void put(@RequestBody Map<String, Object> requestData) {
requestData.entrySet().forEach(stringObjectEntry -> {
System.out.println("key : " + stringObjectEntry.getKey() +
"value : " + stringObjectEntry.getValue());
@PutMapping("put-object-entity")
public ResponseEntity<PostUserRequest> putObjectEntity(@RequestBody PostUserRequest requestData) {
return ResponseEntity.status(HttpStatus.CREATED).body(requestData);
}
→ Response 201 : created
@GetMapping("/get")
public PostUserRequest getUser() {
PostUserRequest user = new PostUserRequest();
user.setName("tester1234");
return user;
}
PageController
@Controller
public class PageController {
@RequestMapping("/main")
public String main() {
return "main.html";
}
}
짜잔!
@JsonInclude(JsonInclude.Include.*NON_NULL*)
⚠️ 화살표 디렉토리 수정
rm -rf .git
git rm --cached . -rf