Search in sources :

Example 1 with CouponWarpper

use of com.ikoori.vip.server.modular.biz.warpper.CouponWarpper in project vip by guangdada.

the class CouponController method list.

/**
 * 获取优惠券列表
 */
@RequestMapping(value = "/list")
@Permission
@ResponseBody
public Object list(String couponName, Long storeId, Boolean isExpired, Boolean isInvalid, Integer type) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Page<Coupon> page = new PageFactory<Coupon>().defaultPage();
    List<Map<String, Object>> result = couponService.getCouponList(merchant.getId(), isExpired, isInvalid, type, storeId, page, couponName, page.getOrderByField(), page.isAsc());
    page.setRecords((List<Coupon>) new CouponWarpper(result).warp());
    return super.packForBT(page);
}
Also used : StoreCoupon(com.ikoori.vip.common.persistence.model.StoreCoupon) Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) CouponWarpper(com.ikoori.vip.server.modular.biz.warpper.CouponWarpper) HashMap(java.util.HashMap) Map(java.util.Map) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

Permission (com.ikoori.vip.common.annotion.Permission)1 Coupon (com.ikoori.vip.common.persistence.model.Coupon)1 Merchant (com.ikoori.vip.common.persistence.model.Merchant)1 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)1 CouponWarpper (com.ikoori.vip.server.modular.biz.warpper.CouponWarpper)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1