문제점을 설명하기 위해 약간의 샘플 프로젝트를 구현했습니다. 그것은 여기에 있어요 :@ 프로젝션이 작동하지 않습니다.
https://github.com/jvillane/spring-boot-hateoas-rest
내가 뭘 같은 법인의 @Projection 여러 년대 만드는 할 노력하고있어 :
@Projection(name = "S", types = User.class) public interface UserS { String getName(); } @Projection(name = "M", types = User.class) public interface UserM { String getName(); String getDni(); } @Projection(name = "L", types = User.class) public interface UserL { String getName(); String getDni(); Country getCountry(); }
을 그리고 얻기 위해 그들을 사용하여 더 많은 또는 을 덜 전화 번호 (따옴표 포함 또는 불포함) : http://localhost:8080/api/users/1?projection=S
http://localhost:8080/api/users/1?projection=M
http://localhost:8080/api/users/1?projection=L
그러나 응답에서 차이를 만들지는 않습니다. 기본 방법을 사용하여 개체 정보를 표시하는 것과 같습니다.
내가 뭘 잘못하고 있는지 모르겠다. 어떤 도움도 환영합니다.