【发布时间】:2023-03-12 17:40:01
【问题描述】:
我正在使用 Spring Boot 中的 PagingAndSortingRepository。
是否可以从http body(json)接收参数,而不是通过查询参数(@Param)接收。
例子:
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
public interface PersonRepository extends PagingAndSortingRepository<Person, Long> {
List<Person> findByLastName(@Param("name") String name);
Person findByUsername(@Param("username") String username);
}
我正在寻找@Param("name") String name 的替代方法,以便从 JSON-Body 而不是查询参数中提取值。
【问题讨论】:
标签: json spring-boot query-parameters spring-repositories