아하! 내가 찾고있는 건 org.springframework.data.rest.core.annotation.RepositoryRestResource
봄 데이터 나머지 webmvc 프로젝트에 위치해 있습니다. 받는다는 좌표 : "org.springframework.data:spring-data-rest-webmvc"
documentation에서 예 추출물이 저장소는 인터페이스이고 당신을 수
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
List<Person> findByLastName(@Param("name") String name);
}
enter code here
Person 객체와 관련된 다양한 작업을 수행합니다. Spring Data Commons에 정의 된 PagingAndSortingRepositry 인터페이스를 확장하여 이러한 작업을 얻습니다.
런타임시 스프링 데이터 REST는이 인터페이스의 구현을 자동으로 작성합니다. 그런 다음 @RepositoryRestResource> 주석을 사용하여 Spring MVC가/people에 RESTful 끝점을 생성하도록 지시한다.