public Result<PageInfo<QueryCouponResponse>> queryCoupon(@RequestBody QueryCouponRequest queryCouponRequest) {
List<QueryCouponResponse> couponResponses = null;
Page<Object> page = PageHelper.startPage(queryCouponRequest.getPageNum(), queryCouponRequest.getPageSize());
couponResponses = themisCouponsMapper.queryCouponList(queryCouponRequest);
log.info("query list nums:{}", couponResponses.size());
for (QueryCouponResponse couponResponse:couponResponses){
couponResponse.setCouponStatusName(CoupouStatus.getValueByCode(couponResponse.getCouponStatus()));
}
PageInfo<QueryCouponResponse> pageInfo = new PageInfo<>();
pageInfo.setListInfo(couponResponses);
pageInfo.setTotal(page.getTotal());
return Result.success(pageInfo);
}
PageHelper分页查询案例
最新推荐文章于 2024-08-26 23:00:00 发布