【同步】BOOT 和 CLOUD 的功能(支付相关)

This commit is contained in:
YunaiV
2024-11-25 20:26:00 +08:00
parent 90d006b4c9
commit 50e47434bb
98 changed files with 1209 additions and 345 deletions

View File

@@ -51,7 +51,8 @@ public class ProductBrowseHistoryController {
convertSet(pageResult.getList(), ProductBrowseHistoryDO::getSpuId));
return success(BeanUtils.toBean(pageResult, ProductBrowseHistoryRespVO.class,
vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
.setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
}
}

View File

@@ -1,12 +1,9 @@
package cn.iocoder.yudao.module.product.controller.admin.history.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED;
@Schema(description = "管理后台 - 商品浏览记录 Response VO")
@@ -31,4 +28,10 @@ public class ProductBrowseHistoryRespVO {
@Schema(description = "商品单价", example = "100")
private Integer price;
@Schema(description = "商品销量", example = "100")
private Integer salesCount;
@Schema(description = "库存", example = "100")
private Integer stock;
}

View File

@@ -67,7 +67,8 @@ public class AppProductBrowseHistoryController {
Map<Long, ProductSpuDO> spuMap = convertMap(productSpuService.getSpuList(spuIds), ProductSpuDO::getId);
return success(BeanUtils.toBean(pageResult, AppProductBrowseHistoryRespVO.class,
vo -> Optional.ofNullable(spuMap.get(vo.getSpuId()))
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice()))));
.ifPresent(spu -> vo.setSpuName(spu.getName()).setPicUrl(spu.getPicUrl()).setPrice(spu.getPrice())
.setSalesCount(spu.getSalesCount()).setStock(spu.getStock()))));
}
}

View File

@@ -17,13 +17,19 @@ public class AppProductBrowseHistoryRespVO {
// ========== 商品相关字段 ==========
@Schema(description = "商品 SPU 名称", example = "赵六")
@Schema(description = "商品 SPU 名称", requiredMode = REQUIRED, example = "赵六")
private String spuName;
@Schema(description = "商品封面图", example = "https://domain/pic.png")
@Schema(description = "商品封面图", requiredMode = REQUIRED, example = "https://www.iocoder.cn/pic.png")
private String picUrl;
@Schema(description = "商品单价", example = "100")
@Schema(description = "商品单价", requiredMode = REQUIRED, example = "50")
private Integer price;
@Schema(description = "商品销量", requiredMode = REQUIRED, example = "60")
private Integer salesCount;
@Schema(description = "库存", requiredMode = REQUIRED, example = "80")
private Integer stock;
}