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";
}
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";
}
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";
}
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;
}
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;
}
Aggregations