inflearn logo
Course

Course

Instructor

yonhasky's Posts

yonhasky yonhasky

@yonhasky2925

Reviews Written
-
Average Rating
-

Posts 1

Q&A

Resource HateOAS

버전문제로 이전강의 때 수정했던 내용 참조하여 아래와 같이 만들었습니다. @GetMapping("/users/{id}") public EntityModel retrieveUser(@PathVariable int id) { Optional user = userRepository.findById(id); if (!user.isPresent()) { throw new UserNotFoundException(String.format("ID[%s] not found", id)); } EntityModel model = EntityModel.of(user.get()); WebMvcLinkBuilder linkTo = WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(this.getClass()).retrieveAllUsers()); model.add(linkTo.withRel("all-users")); return model; }

Likes
1
Comments
3
Viewcount
414