1
默认情况下,Spring Data REST将向{resource_name}/search
下的网址公开搜索资源。例如,以下代码中的findBySubject_Id
将暴露于{baseUrl}/questions/search/findBySubject_Id?subjectId={subjectId}
。更改弹簧数据REST暴露链接
public interface QuestionRepository extends PagingAndSortingRepository<Question, String> {
Page<Question> findBySubject_Id(@Param("subjectId")String subjectId, Pageable pageable);
}
为了兼容性的原因,我需要的暴露链接是{baseUrl}/questions?subjectId={subjectId}
。有什么办法可以做到吗?