Skip to content

Commit

Permalink
!787 合并最新商城代码
Browse files Browse the repository at this point in the history
Merge pull request !787 from 芋道源码/feature/mall_product
  • Loading branch information
YunaiV authored and gitee-org committed Dec 7, 2023
2 parents 2ad27a4 + 4a3aa1f commit a8e8c14
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import javax.annotation.Resource;
import javax.validation.Valid;

import java.util.Collection;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 优惠劵模板")
Expand Down Expand Up @@ -75,4 +78,14 @@ public CommonResult<PageResult<CouponTemplateRespVO>> getCouponTemplatePage(@Val
PageResult<CouponTemplateDO> pageResult = couponTemplateService.getCouponTemplatePage(pageVO);
return success(CouponTemplateConvert.INSTANCE.convertPage(pageResult));
}

@GetMapping("/list")
@Operation(summary = "获得优惠劵模板列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('promotion:coupon-template:query')")
public CommonResult<List<CouponTemplateRespVO>> getCouponTemplateList(@RequestParam("ids") Collection<Long> ids) {
List<CouponTemplateDO> list = couponTemplateService.getCouponTemplateList(ids);
return success(CouponTemplateConvert.INSTANCE.convertList(list));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public CommonResult<List<AppCouponTemplateRespVO>> getCouponTemplateList(
return success(CouponTemplateConvert.INSTANCE.convertAppList(list, canCanTakeMap));
}

@GetMapping("/list-by-ids")
@Operation(summary = "获得优惠劵模版列表")
@Parameter(name = "ids", description = "优惠券模板编号列表")
public CommonResult<List<AppCouponTemplateRespVO>> getCouponTemplateList(
@RequestParam(value = "ids", required = false) Set<Long> ids) {
// 1. 查询
List<CouponTemplateDO> list = couponTemplateService.getCouponTemplateList(ids);

// 2.1 领取数量
Map<Long, Boolean> canCanTakeMap = couponService.getUserCanCanTakeMap(getLoginUserId(), list);
// 2.2 拼接返回
return success(CouponTemplateConvert.INSTANCE.convertAppList(list, canCanTakeMap));
}

@GetMapping("/page")
@Operation(summary = "获得优惠劵模版分页")
public CommonResult<PageResult<AppCouponTemplateRespVO>> getCouponTemplatePage(AppCouponTemplatePageReqVO pageReqVO) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ default void copyTo(List<AppCouponTemplateRespVO> list, Map<Long, Boolean> userC
}
}

List<CouponTemplateRespVO> convertList(List<CouponTemplateDO> list);

}

0 comments on commit a8e8c14

Please sign in to comment.