常用注解@PageableDefault

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

import org.springframework.data.domain.Pageable;

@GetMapping
    public List 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 users = Lists.newArrayList();
        users.add(new User());
        users.add(new User());
        users.add(new User());
        return users;
    }

你可能感兴趣的:(annotation)