java lambda 分页

  • A+
所属分类:Java
String jobPageList = redisService.getValue("recruit-job-list-page");
if (StringUtils.isNotEmpty(jobPageList)){
    List<RecruitJobInfoRemoteDTO> list = JSONArray.parseArray(jobPageList,RecruitJobInfoRemoteDTO.class);

    if (sourceType!=null&&sourceType>0){
        List<RecruitJobInfoRemoteDTO> result = list.stream().filter(
                recruitJobInfoRemoteDTO ->
                        (recruitJobInfoRemoteDTO.getJobTitle().contains(jobTitle) && recruitJobInfoRemoteDTO.getJobResource().equals(sourceType))
        ).skip(pageSize * (pageNum - 1)).limit(pageSize).collect(Collectors.toList());

    }

}

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: