Search in sources :

Example 1 with CouponCategory

use of com.whoiszxl.entity.CouponCategory in project shopzz by whoiszxl.

the class PromotionFeignClientImpl method getCoupon.

@Override
public ResponseResult<CouponFeignDTO> getCoupon(Long couponId) {
    Coupon coupon = couponService.getById(couponId);
    CouponFeignDTO couponFeignDTO = dozerUtils.map(coupon, CouponFeignDTO.class);
    List<CouponCategory> couponCategoryList = couponCategoryService.list(Wrappers.<CouponCategory>lambdaQuery().eq(CouponCategory::getCouponId, couponId));
    List<Long> categoryIdList = couponCategoryList.stream().map(CouponCategory::getCategoryId).collect(Collectors.toList());
    couponFeignDTO.setCategoryIdList(categoryIdList);
    return ResponseResult.buildSuccess(couponFeignDTO);
}
Also used : Coupon(com.whoiszxl.entity.Coupon) MemberCoupon(com.whoiszxl.entity.MemberCoupon) CouponCategory(com.whoiszxl.entity.CouponCategory) CouponFeignDTO(com.whoiszxl.dto.CouponFeignDTO)

Aggregations

CouponFeignDTO (com.whoiszxl.dto.CouponFeignDTO)1 Coupon (com.whoiszxl.entity.Coupon)1 CouponCategory (com.whoiszxl.entity.CouponCategory)1 MemberCoupon (com.whoiszxl.entity.MemberCoupon)1