promotion:完善优惠劵模板的功能

This commit is contained in:
YunaiV
2022-11-02 22:19:33 +08:00
parent 2aaeb7af88
commit bd661296c0
12 changed files with 104 additions and 536 deletions

View File

@@ -53,6 +53,7 @@ public class ProductSpuController {
return success(true);
}
// TODO 芋艿:修改接口
@GetMapping("/get/detail")
@ApiOperation("获得商品 SPU")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@@ -79,6 +80,14 @@ public class ProductSpuController {
return success(ProductSpuConvert.INSTANCE.convertList(list));
}
@GetMapping("/get-simple-list")
@ApiOperation("获得商品 SPU 精简列表")
@PreAuthorize("@ss.hasPermission('product:spu:query')")
public CommonResult<List<ProductSpuSimpleRespVO>> getSpuSimpleList() {
List<ProductSpuDO> list = spuService.getSpuList();
return success(ProductSpuConvert.INSTANCE.convertList02(list));
}
@GetMapping("/page")
@ApiOperation("获得商品 SPU 分页")
@PreAuthorize("@ss.hasPermission('product:spu:query')")

View File

@@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.product.controller.admin.spu.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@ApiModel("管理后台 - 商品 SPU 精简 Response VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductSpuSimpleRespVO extends ProductSpuBaseVO {
@ApiModelProperty(value = "主键", required = true, example = "1")
private Long id;
@ApiModelProperty(value = "商品名称", required = true, example = "芋道")
private String name;
@ApiModelProperty(value = " 最小价格,单位使用:分", required = true, example = "1024")
private Integer minPrice;
@ApiModelProperty(value = "最大价格,单位使用:分", required = true, example = "1024")
private Integer maxPrice;
}

View File

@@ -36,5 +36,7 @@ public interface ProductSpuConvert {
AppSpuPageRespVO convertAppResp(ProductSpuDO list);
List<SpuInfoRespDTO> convertList2(List<ProductSpuDO> list);
List<ProductSpuSimpleRespVO> convertList02(List<ProductSpuDO> list);
}

View File

@@ -63,6 +63,13 @@ public interface ProductSpuService {
*/
List<ProductSpuDO> getSpuList(Collection<Long> ids);
/**
* 获得所有商品 SPU 列表
*
* @return 商品 SPU 列表
*/
List<ProductSpuDO> getSpuList();
/**
* 获得商品 SPU 分页
*

View File

@@ -176,6 +176,11 @@ public class ProductSpuServiceImpl implements ProductSpuService {
return productSpuMapper.selectBatchIds(ids);
}
@Override
public List<ProductSpuDO> getSpuList() {
return productSpuMapper.selectList();
}
@Override
public PageResult<ProductSpuRespVO> getSpuPage(ProductSpuPageReqVO pageReqVO) {
// 库存告警的 SPU 编号的集合