| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @PostMapping("/list") |
| | | @ApiOperation(value = "优惠劵管理-列表", tags = {"管理后台-活动管理"}) |
| | | public R<IPage<CouponInfo>> list(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | CouponInfo couponInfo) { |
| | | return R.ok(couponInfoService.queryCouponInfoPage(Page.of(pageNum, pageSize), couponInfo)); |
| | | } |
| | | |
| | | |
| | | //查看详情 |
| | | @PostMapping("/detail") |
| | | @ApiOperation(value = "活动管理-优惠劵管理-详情", tags = {"管理后台"}) |
| | | @ApiOperation(value = "优惠劵管理-详情", tags = {"管理后台-活动管理"}) |
| | | public R<CouponInfo> detail(@RequestParam("id") Integer id){ |
| | | CouponInfo byId = couponInfoService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | // 删除优惠劵 |
| | | @PostMapping("/delete") |
| | | @ApiOperation(value = "优惠劵管理-删除", tags = {"管理后台-活动管理"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id) { |
| | | couponInfoService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 编辑优惠劵 |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "优惠劵管理-编辑", tags = {"管理后台-活动管理"}) |
| | | public R<Void> edit(@RequestBody CouponInfo couponInfo) { |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 修改上/下架状态 |
| | | @PostMapping("/editStatus") |
| | | @ApiOperation(value = "优惠劵管理-修改上/下架状态", tags = {"管理后台-活动管理"}) |
| | | public R<Void> editStatus(@RequestParam("id") Integer id, |
| | | @RequestParam("shelfStatus") Integer shelfStatus) { |
| | | CouponInfo couponInfo = new CouponInfo(); |
| | | couponInfo.setId(id); |
| | | couponInfo.setShelfStatus(shelfStatus); |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/gift/list") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取优惠券数据 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |