Spring Data Jpa规范<DTO>到规范<ENTITY>

时间:2020-07-21 11:42:16

标签: spring spring-boot spring-data-jpa

我的rest控制器获取为@SearchSpecs Specification规范,我尝试在服务中将此映射到Specification以在存储库中使用它。您有任何想法怎么做吗?

控制器:

fill_between

服务:

    @GetMapping("/")
    public Page<DTO> findAll(@SearchSpec Specification<DTO> specs,
                           @RequestParam(defaultValue = "0") Integer pageNo,
                           @RequestParam(defaultValue = "10") Integer pageSize,
                           @RequestParam(defaultValue = "id") String sortBy) {
    return service.findAll(pageNo, pageSize, sortBy, specs);

0 个答案:

没有答案
相关问题