!787 合并最新商城代码

Merge pull request !787 from 芋道源码/feature/mall_product
This commit is contained in:
芋道源码 2023-12-07 11:48:54 +00:00 committed by Gitee
commit a8e8c14ab3
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 29 additions and 0 deletions

View File

@ -16,6 +16,9 @@ import org.springframework.web.bind.annotation.*;
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 = "管理后台 - 优惠劵模板")
@ -75,4 +78,14 @@ public class CouponTemplateController {
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));
}
}

View File

@ -69,6 +69,20 @@ public class AppCouponTemplateController {
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) {

View File

@ -58,4 +58,6 @@ public interface CouponTemplateConvert {
}
}
List<CouponTemplateRespVO> convertList(List<CouponTemplateDO> list);
}