Search in sources :

Example 51 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class PictureController method pictureUpdate.

/**
 * 跳转到修改图片
 */
@Permission
@RequestMapping("/picture_update/{pictureId}")
public String pictureUpdate(@PathVariable Long pictureId, Model model) {
    Picture picture = pictureService.selectById(pictureId);
    model.addAttribute(picture);
    return PREFIX + "picture_edit.html";
}
Also used : Picture(com.ikoori.vip.common.persistence.model.Picture) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 52 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class ShareController method shareUpdate.

/**
 * 跳转到修改分享规则
 */
@Permission
@RequestMapping("/share_update/{shareId}")
public String shareUpdate(@PathVariable Long shareId, Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> couponCon = new HashMap<String, Object>();
    couponCon.put("merchantId", merchant.getId());
    couponCon.put("type", CouponType.YHQ.getCode());
    couponCon.put("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    Share share = shareService.selectById(shareId);
    model.addAttribute(share);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    return PREFIX + "share_edit.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Share(com.ikoori.vip.common.persistence.model.Share) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 53 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class ShareController method shareAdd.

/**
 * 跳转到添加分享规则
 */
@Permission
@RequestMapping("/share_add")
public String shareAdd(Model model) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    Map<String, Object> couponCon = new HashMap<String, Object>();
    couponCon.put("merchantId", merchant.getId());
    couponCon.put("type", CouponType.YHQ.getCode());
    couponCon.put("invalid", true);
    List<Coupon> coupons = couponService.selectByCondition(couponCon);
    // 查询优惠群
    model.addAttribute("coupons", coupons);
    return PREFIX + "share_add.html";
}
Also used : Coupon(com.ikoori.vip.common.persistence.model.Coupon) Merchant(com.ikoori.vip.common.persistence.model.Merchant) HashMap(java.util.HashMap) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 54 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class ShareController method update.

/**
 * 修改分享规则
 */
@RequestMapping(value = "/update")
@Permission
@ResponseBody
public Object update(Share share) {
    if (ToolUtil.isEmpty(share) || share.getId() == null) {
        throw new BussinessException(BizExceptionEnum.REQUEST_NULL);
    }
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    share.setMerchantId(merchant.getId());
    shareService.saveShare(share);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) BussinessException(com.ikoori.vip.common.exception.BussinessException) Permission(com.ikoori.vip.common.annotion.Permission) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 55 with Permission

use of com.ikoori.vip.common.annotion.Permission in project vip by guangdada.

the class ShareController method add.

/**
 * 新增分享规则
 */
@RequestMapping(value = "/add")
@Permission
@ResponseBody
public Object add(Share share) {
    Long userId = Long.valueOf(ShiroKit.getUser().getId());
    Merchant merchant = merchantService.getMerchantUserId(userId);
    share.setMerchantId(merchant.getId());
    shareService.saveShare(share);
    return super.SUCCESS_TIP;
}
Also used : Merchant(com.ikoori.vip.common.persistence.model.Merchant) 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)93 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)92 Merchant (com.ikoori.vip.common.persistence.model.Merchant)55 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)47 HashMap (java.util.HashMap)31 Map (java.util.Map)23 BussinessException (com.ikoori.vip.common.exception.BussinessException)18 Store (com.ikoori.vip.common.persistence.model.Store)12 Coupon (com.ikoori.vip.common.persistence.model.Coupon)11 Card (com.ikoori.vip.common.persistence.model.Card)9 MemberCard (com.ikoori.vip.common.persistence.model.MemberCard)6 StoreCoupon (com.ikoori.vip.common.persistence.model.StoreCoupon)6 User (com.ikoori.vip.common.persistence.model.User)6 ShiroUser (com.ikoori.vip.server.core.shiro.ShiroUser)4 LinkedHashMap (java.util.LinkedHashMap)4 BussinessLog (com.ikoori.vip.common.annotion.log.BussinessLog)3 OperationLog (com.ikoori.vip.common.persistence.model.OperationLog)3 WxConfig (com.ikoori.vip.common.persistence.model.WxConfig)3 LogWarpper (com.ikoori.vip.server.modular.system.warpper.LogWarpper)3 EntityWrapper (com.baomidou.mybatisplus.mapper.EntityWrapper)2