|
@@ -20,14 +20,11 @@ import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.coupon.CouponFontService;
|
|
import com.cyksj.service.coupon.CouponFontService;
|
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
import com.cyksj.web.util.StpUserUtil;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
-import com.ejlchina.searcher.SearchResult;
|
|
|
|
|
import com.ejlchina.searcher.param.Operator;
|
|
import com.ejlchina.searcher.param.Operator;
|
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
-
|
|
|
|
|
/*
|
|
/*
|
|
|
*项目名: netflix
|
|
*项目名: netflix
|
|
|
*文件名: CouponFrontController
|
|
*文件名: CouponFrontController
|
|
@@ -70,16 +67,11 @@ public class CouponFrontController {
|
|
|
* 个人优惠券列表
|
|
* 个人优惠券列表
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/personal/list")
|
|
@GetMapping("/personal/list")
|
|
|
- public Result<SearchResult<CouponUserView>> couponPersonalList(HttpServletRequest request) {
|
|
|
|
|
|
|
+ public Result<Page<CouponUserView>> couponPersonalList(@RequestParam(defaultValue = "1") Long start, @RequestParam(defaultValue = "5") Long limit) {
|
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
Long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- SearchResult<CouponUserView> search = beanSearcher.search(CouponUserView.class,
|
|
|
|
|
- MapUtils.flatBuilder(request.getParameterMap())
|
|
|
|
|
- .field(CouponUserView::getUserId, userId)
|
|
|
|
|
- .field(CouponUserView::getChannel, CouponUser.Channel.exCode).op(Operator.NotEqual)
|
|
|
|
|
- .orderBy(CouponUserView::getOrderBy).asc()
|
|
|
|
|
- .build());
|
|
|
|
|
- couponFontService.handleCouponStatus(search);
|
|
|
|
|
- return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
|
|
|
|
+ Page<CouponUserView> page = couponUserMapper.couponPersonalList(userId, new Page<>(start, limit));
|
|
|
|
|
+ couponFontService.handleCouponStatus(page.getRecords());
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(page);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|