【功能完善】商城: APP 完善积分商城活动接口返回

This commit is contained in:
puhui999 2024-10-02 15:26:25 +08:00
parent 14d239f2de
commit f72dd272a2
2 changed files with 12 additions and 0 deletions

View File

@ -74,7 +74,11 @@ public class AppPointActivityController {
// 2. 拼接数据 // 2. 拼接数据
List<PointProductDO> products = pointActivityService.getPointProductListByActivityIds(Collections.singletonList(id)); List<PointProductDO> products = pointActivityService.getPointProductListByActivityIds(Collections.singletonList(id));
AppPointActivityDetailRespVO respVO = BeanUtils.toBean(activity, AppPointActivityDetailRespVO.class); AppPointActivityDetailRespVO respVO = BeanUtils.toBean(activity, AppPointActivityDetailRespVO.class);
// 设置 product 信息
respVO.setProducts(BeanUtils.toBean(products, AppPointActivityDetailRespVO.Product.class)); respVO.setProducts(BeanUtils.toBean(products, AppPointActivityDetailRespVO.Product.class));
PointProductDO minProduct = getMinPropertyObj(products, PointProductDO::getPoint);
assert minProduct != null;
respVO.setPoint(minProduct.getPoint()).setPrice(minProduct.getPrice());
return success(respVO); return success(respVO);
} }

View File

@ -30,6 +30,14 @@ public class AppPointActivityDetailRespVO {
@Schema(description = "商品信息数组", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "商品信息数组", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Product> products; private List<Product> products;
//======================= 显示所需兑换积分最少的 sku 信息 =======================
@Schema(description = "兑换积分", requiredMode = Schema.RequiredMode.REQUIRED)
private Integer point;
@Schema(description = "兑换金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "15860")
private Integer price;
@Schema(description = "商品信息") @Schema(description = "商品信息")
@Data @Data
public static class Product { public static class Product {