Commit f5b2bb4d7d4c70f9fca48588cedd3f2431b06dbf

Authored by YunaiV
1 parent c33bd38b

mall + promotion:增加砍价记录的 mock

yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/AppBargainRecordController.java
1 package cn.iocoder.yudao.module.promotion.controller.app.bargain; 1 package cn.iocoder.yudao.module.promotion.controller.app.bargain;
2 2
3 import cn.iocoder.yudao.framework.common.pojo.CommonResult; 3 import cn.iocoder.yudao.framework.common.pojo.CommonResult;
  4 +import cn.iocoder.yudao.framework.common.pojo.PageParam;
  5 +import cn.iocoder.yudao.framework.common.pojo.PageResult;
4 import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; 6 import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils;
5 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordCreateReqVO; 7 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordCreateReqVO;
6 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordDetailRespVO; 8 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordDetailRespVO;
  9 +import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordRespVO;
7 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordSummaryRespVO; 10 import cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record.AppBargainRecordSummaryRespVO;
8 import io.swagger.v3.oas.annotations.Operation; 11 import io.swagger.v3.oas.annotations.Operation;
9 import io.swagger.v3.oas.annotations.tags.Tag; 12 import io.swagger.v3.oas.annotations.tags.Tag;
@@ -64,6 +67,77 @@ public class AppBargainRecordController { @@ -64,6 +67,77 @@ public class AppBargainRecordController {
64 return success(detail); 67 return success(detail);
65 } 68 }
66 69
  70 + @GetMapping("/page")
  71 + @Operation(summary = "获得砍价记录的分页")
  72 + public CommonResult<PageResult<AppBargainRecordRespVO>> getBargainRecordPage(PageParam pageParam) {
  73 + PageResult<AppBargainRecordRespVO> page = new PageResult<>();
  74 + page.setList(new ArrayList<>());
  75 + AppBargainRecordRespVO record1 = new AppBargainRecordRespVO();
  76 + record1.setId(1L);
  77 + record1.setUserId(1L);
  78 + record1.setSpuId(1L);
  79 + record1.setSkuId(1L);
  80 + record1.setPrice(500);
  81 + record1.setActivityId(1L);
  82 + record1.setBargainPrice(150);
  83 + record1.setPrice(200);
  84 + record1.setPayPrice(180);
  85 + record1.setStatus(1);
  86 + record1.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg");
  87 + record1.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2)));
  88 + page.getList().add(record1);
  89 +
  90 + AppBargainRecordRespVO record2 = new AppBargainRecordRespVO();
  91 + record2.setId(1L);
  92 + record2.setUserId(1L);
  93 + record2.setSpuId(1L);
  94 + record2.setSkuId(1L);
  95 + record2.setPrice(500);
  96 + record2.setActivityId(1L);
  97 + record2.setBargainPrice(150);
  98 + record2.setPrice(200);
  99 + record2.setPayPrice(280);
  100 + record2.setStatus(2);
  101 + record2.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg");
  102 + record2.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2)));
  103 + page.getList().add(record2);
  104 +
  105 + AppBargainRecordRespVO record3 = new AppBargainRecordRespVO();
  106 + record3.setId(1L);
  107 + record3.setUserId(1L);
  108 + record3.setSpuId(1L);
  109 + record3.setSkuId(1L);
  110 + record3.setPrice(500);
  111 + record3.setActivityId(1L);
  112 + record3.setBargainPrice(150);
  113 + record3.setPrice(200);
  114 + record3.setPayPrice(380);
  115 + record3.setStatus(2);
  116 + record3.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg");
  117 + record3.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2)));
  118 + record3.setOrderId(100L);
  119 + page.getList().add(record3);
  120 +
  121 + AppBargainRecordRespVO record4 = new AppBargainRecordRespVO();
  122 + record4.setId(1L);
  123 + record4.setUserId(1L);
  124 + record4.setSpuId(1L);
  125 + record4.setSkuId(1L);
  126 + record4.setPrice(500);
  127 + record4.setActivityId(1L);
  128 + record4.setBargainPrice(150);
  129 + record4.setPrice(200);
  130 + record4.setPayPrice(380);
  131 + record4.setStatus(3);
  132 + record4.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg");
  133 + record4.setExpireTime(LocalDateTimeUtils.addTime(Duration.ofDays(2)));
  134 + record4.setOrderId(100L);
  135 + page.getList().add(record4);
  136 +
  137 + page.setTotal(1L);
  138 + return success(page);
  139 + }
  140 +
67 @PostMapping("/create") 141 @PostMapping("/create")
68 @Operation(summary = "创建砍价记录", description = "参与拼团活动") 142 @Operation(summary = "创建砍价记录", description = "参与拼团活动")
69 public CommonResult<Long> createBargainRecord(@RequestBody AppBargainRecordCreateReqVO reqVO) { 143 public CommonResult<Long> createBargainRecord(@RequestBody AppBargainRecordCreateReqVO reqVO) {
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/bargain/vo/record/AppBargainRecordRespVO.java 0 → 100644
  1 +package cn.iocoder.yudao.module.promotion.controller.app.bargain.vo.record;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.Data;
  5 +
  6 +import java.time.LocalDateTime;
  7 +
  8 +@Schema(description = "用户 App - 砍价记录的 Response VO")
  9 +@Data
  10 +public class AppBargainRecordRespVO {
  11 +
  12 + // TODO @芋艿:status;如果砍价对应的订单支付超时,算失败么?砍价的支付时间,以 expireTime 为准么?
  13 +
  14 + private Long id;
  15 + private Long userId;
  16 + private Long spuId;
  17 + private Long skuId;
  18 + private Long activityId;
  19 + private Integer bargainPrice;
  20 + private Integer price;
  21 + private Integer payPrice;
  22 + private Integer status;
  23 + private LocalDateTime expireTime;
  24 +
  25 + private Long orderId;
  26 + private Boolean payStatus;
  27 + private Long payOrderId;
  28 +
  29 + private String activityName;
  30 + private String picUrl;
  31 +
  32 +}