From af9334c9b23567a79e091fede55cd977358227ac Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 16 Jun 2023 00:12:49 +0800 Subject: [PATCH] =?UTF-8?q?mall=20+=20trade=EF=BC=9Amock=20=E6=8B=BC?= =?UTF-8?q?=E5=9B=A2=E8=AE=B0=E5=BD=95=E8=AF=A6=E6=83=85=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... => AppCombinationActivityController.java} | 8 +- .../AppCombinationRecordController.java | 78 +++++++++++++++++++ .../AppCombinationActivityDetailRespVO.java | 21 ++--- .../AppCombinationRecordDetailRespVO.java | 21 +++++ .../AppCombinationRecordSimpleRespVO.java | 30 +++++++ .../vo/AppSeckillActivitiDetailRespVO.java | 3 - 6 files changed, 140 insertions(+), 21 deletions(-) rename yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/{AppCombinationController.java => AppCombinationActivityController.java} (92%) create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java create mode 100644 yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java similarity index 92% rename from yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationController.java rename to yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java index cd6d142a2..ba4c01e9a 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.java @@ -21,7 +21,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/promotion/combination-activity") @Validated -public class AppCombinationController { +public class AppCombinationActivityController { @GetMapping("/get-detail") @Operation(summary = "获得拼团活动明细") @@ -33,8 +33,10 @@ public class AppCombinationController { obj.setId(id); obj.setName("晚九点限时秒杀"); obj.setStatus(1); - obj.setStartTime(LocalDateTime.of(2023, 6, 11, 0, 0, 0)); - obj.setEndTime(LocalDateTime.of(2023, 6, 11, 23, 59, 0)); + obj.setStartTime(LocalDateTime.of(2023, 6, 15, 0, 0, 0)); + obj.setEndTime(LocalDateTime.of(2023, 6, 15, 23, 59, 0)); + obj.setUserSize(2); + obj.setSuccessCount(100); obj.setSpuId(633L); // 创建一个Product对象的列表 List productList = new ArrayList<>(); diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java new file mode 100644 index 000000000..1e32111f1 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java @@ -0,0 +1,78 @@ +package cn.iocoder.yudao.module.promotion.controller.app.combination; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSimpleRespVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.constraints.Max; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "用户 APP - 拼团活动") +@RestController +@RequestMapping("/promotion/combination-record") +@Validated +public class AppCombinationRecordController { + + @GetMapping("/get-head-list") + @Operation(summary = "获得最近 n 条拼团记录(团长发起的)") + public CommonResult> getHeadCombinationRecordList( + @RequestParam("status") Integer status, + @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { + List list = new ArrayList<>(); + for (int i = 1; i <= count; i++) { + AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); + record.setId((long) i); + record.setNickname("用户" + i); + record.setAvatar("头像" + i); + record.setExpireTime(new Date()); + record.setUserSize(10); + record.setUserCount(i); + list.add(record); + } + return success(list); + } + + @GetMapping("/get-detail") + @Operation(summary = "获得拼团记录明细") + @Parameter(name = "id", description = "拼团记录编号", required = true, example = "1024") + public CommonResult getCombinationRecordDetail(@RequestParam("id") Long id) { + AppCombinationRecordDetailRespVO detail = new AppCombinationRecordDetailRespVO(); + // 团长 + AppCombinationRecordSimpleRespVO headRecord = new AppCombinationRecordSimpleRespVO(); + headRecord.setId(1L); + headRecord.setNickname("用户" + 1); + headRecord.setAvatar("头像" + 1); + headRecord.setExpireTime(new Date()); + headRecord.setUserSize(10); + headRecord.setUserCount(3); + // 团员 + List list = new ArrayList<>(); + for (int i = 1; i <= 2; i++) { + AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); + record.setId((long) i); + record.setNickname("用户" + i); + record.setAvatar("头像" + i); + record.setExpireTime(new Date()); + record.setUserSize(10); + record.setUserCount(i); + list.add(record); + } + detail.setMemberRecords(list); + // 订单编号 + detail.setOrderId(100L); + return success(detail); + } + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/activity/AppCombinationActivityDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/activity/AppCombinationActivityDetailRespVO.java index 553a31fd8..79e54d610 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/activity/AppCombinationActivityDetailRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/activity/AppCombinationActivityDetailRespVO.java @@ -25,18 +25,18 @@ public class AppCombinationActivityDetailRespVO { @Schema(description = "活动结束时间", required = true) private LocalDateTime endTime; + @Schema(description = "拼团人数", required = true, example = "3") + private Integer userSize; + + @Schema(description = "成功的拼团数量", required = true, example = "100") + private Integer successCount; + @Schema(description = "商品 SPU 编号", required = true, example = "2048") private Long spuId; @Schema(description = "商品信息数组", required = true) private List products; - @Schema(description = "成功的拼团记录", required = true) - private List successRecords; - - @Schema(description = "进行中的拼团记录", required = true) - private List runningRecords; - @Schema(description = "商品信息") @Data public static class Product { @@ -55,13 +55,4 @@ public class AppCombinationActivityDetailRespVO { } - @Schema(description = "拼团记录") - @Data - public static class Record { - - @Schema(description = "拼团记录编号", required = true, example = "1024") - private Long id; - - } - } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java new file mode 100644 index 000000000..120926ad6 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.List; + +@Schema(description = "用户 App - 拼团记录详细 Response VO") +@Data +public class AppCombinationRecordDetailRespVO { + + @Schema(description = "团长的拼团记录", required = true) + private AppCombinationRecordSimpleRespVO headRecord; + + @Schema(description = "成员的拼团记录", required = true) + private List memberRecords; + + @Schema(description = "当前用户参团记录对应的订单编号", required = true, example = "1024") // 如果没参团,返回 null + private Long orderId; + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java new file mode 100644 index 000000000..54177aeb8 --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.util.Date; + +@Schema(description = "用户 App - 拼团记录精简 Response VO") +@Data +public class AppCombinationRecordSimpleRespVO { + + @Schema(description = "拼团记录编号", required = true, example = "1024") + private Long id; + + @Schema(description = "用户昵称", required = true, example = "1024") + private String nickname; + + @Schema(description = "用户头像", required = true, example = "1024") + private String avatar; + + @Schema(description = "过期时间", required = true) + private Date expireTime; + + @Schema(description = "可参团人数", required = true, example = "10") + private Integer userSize; + + @Schema(description = "已参团人数", required = true, example = "5") + private Integer userCount; + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/AppSeckillActivitiDetailRespVO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/AppSeckillActivitiDetailRespVO.java index a643fc1b3..0feeac6ff 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/AppSeckillActivitiDetailRespVO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/AppSeckillActivitiDetailRespVO.java @@ -27,9 +27,6 @@ public class AppSeckillActivitiDetailRespVO { @Schema(description = "活动结束时间", required = true) private LocalDateTime endTime; - - private Long successGruopCount; - @Schema(description = "商品 SPU 编号", required = true, example = "2048") private Long spuId;