常用注解@PageableDefault

@RequestParam   映射请求参数到 java方法的参数
@PageableDefault  指定参数分页默认值

import org.springframework.data.domain.Pageable;

@GetMapping
    public List<User> query(UserQueryCondition condition, Pageable pageable) {
        System.out.println(ReflectionToStringBuilder.toString(condition, ToStringStyle.MULTI_LINE_STYLE));
        System.out.println(pageable.getPageSize());
        System.out.println(pageable.getPageNumber());
        System.out.println(pageable.getSort());
        ArrayList<User> users = Lists.newArrayList();
        users.add(new User());
        users.add(new User());
        users.add(new User());
        return users;
    }

猜你喜欢

转载自1971161579.iteye.com/blog/2404101