Commit af9334c9b23567a79e091fede55cd977358227ac
1 parent
1662d17f
mall + trade:mock 拼团记录详情的接口
Showing
6 changed files
with
140 additions
and
21 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationController.java renamed to 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; |
| 21 | 21 | @RestController |
| 22 | 22 | @RequestMapping("/promotion/combination-activity") |
| 23 | 23 | @Validated |
| 24 | -public class AppCombinationController { | |
| 24 | +public class AppCombinationActivityController { | |
| 25 | 25 | |
| 26 | 26 | @GetMapping("/get-detail") |
| 27 | 27 | @Operation(summary = "获得拼团活动明细") |
| ... | ... | @@ -33,8 +33,10 @@ public class AppCombinationController { |
| 33 | 33 | obj.setId(id); |
| 34 | 34 | obj.setName("晚九点限时秒杀"); |
| 35 | 35 | obj.setStatus(1); |
| 36 | - obj.setStartTime(LocalDateTime.of(2023, 6, 11, 0, 0, 0)); | |
| 37 | - obj.setEndTime(LocalDateTime.of(2023, 6, 11, 23, 59, 0)); | |
| 36 | + obj.setStartTime(LocalDateTime.of(2023, 6, 15, 0, 0, 0)); | |
| 37 | + obj.setEndTime(LocalDateTime.of(2023, 6, 15, 23, 59, 0)); | |
| 38 | + obj.setUserSize(2); | |
| 39 | + obj.setSuccessCount(100); | |
| 38 | 40 | obj.setSpuId(633L); |
| 39 | 41 | // 创建一个Product对象的列表 |
| 40 | 42 | List<AppCombinationActivityDetailRespVO.Product> productList = new ArrayList<>(); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.app.combination; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordDetailRespVO; | |
| 5 | +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordSimpleRespVO; | |
| 6 | +import io.swagger.v3.oas.annotations.Operation; | |
| 7 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 8 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 9 | +import org.springframework.validation.annotation.Validated; | |
| 10 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 11 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 12 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | +import org.springframework.web.bind.annotation.RestController; | |
| 14 | + | |
| 15 | +import javax.validation.constraints.Max; | |
| 16 | +import java.util.ArrayList; | |
| 17 | +import java.util.Date; | |
| 18 | +import java.util.List; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 21 | + | |
| 22 | +@Tag(name = "用户 APP - 拼团活动") | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/promotion/combination-record") | |
| 25 | +@Validated | |
| 26 | +public class AppCombinationRecordController { | |
| 27 | + | |
| 28 | + @GetMapping("/get-head-list") | |
| 29 | + @Operation(summary = "获得最近 n 条拼团记录(团长发起的)") | |
| 30 | + public CommonResult<List<AppCombinationRecordSimpleRespVO>> getHeadCombinationRecordList( | |
| 31 | + @RequestParam("status") Integer status, | |
| 32 | + @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { | |
| 33 | + List<AppCombinationRecordSimpleRespVO> list = new ArrayList<>(); | |
| 34 | + for (int i = 1; i <= count; i++) { | |
| 35 | + AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); | |
| 36 | + record.setId((long) i); | |
| 37 | + record.setNickname("用户" + i); | |
| 38 | + record.setAvatar("头像" + i); | |
| 39 | + record.setExpireTime(new Date()); | |
| 40 | + record.setUserSize(10); | |
| 41 | + record.setUserCount(i); | |
| 42 | + list.add(record); | |
| 43 | + } | |
| 44 | + return success(list); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @GetMapping("/get-detail") | |
| 48 | + @Operation(summary = "获得拼团记录明细") | |
| 49 | + @Parameter(name = "id", description = "拼团记录编号", required = true, example = "1024") | |
| 50 | + public CommonResult<AppCombinationRecordDetailRespVO> getCombinationRecordDetail(@RequestParam("id") Long id) { | |
| 51 | + AppCombinationRecordDetailRespVO detail = new AppCombinationRecordDetailRespVO(); | |
| 52 | + // 团长 | |
| 53 | + AppCombinationRecordSimpleRespVO headRecord = new AppCombinationRecordSimpleRespVO(); | |
| 54 | + headRecord.setId(1L); | |
| 55 | + headRecord.setNickname("用户" + 1); | |
| 56 | + headRecord.setAvatar("头像" + 1); | |
| 57 | + headRecord.setExpireTime(new Date()); | |
| 58 | + headRecord.setUserSize(10); | |
| 59 | + headRecord.setUserCount(3); | |
| 60 | + // 团员 | |
| 61 | + List<AppCombinationRecordSimpleRespVO> list = new ArrayList<>(); | |
| 62 | + for (int i = 1; i <= 2; i++) { | |
| 63 | + AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); | |
| 64 | + record.setId((long) i); | |
| 65 | + record.setNickname("用户" + i); | |
| 66 | + record.setAvatar("头像" + i); | |
| 67 | + record.setExpireTime(new Date()); | |
| 68 | + record.setUserSize(10); | |
| 69 | + record.setUserCount(i); | |
| 70 | + list.add(record); | |
| 71 | + } | |
| 72 | + detail.setMemberRecords(list); | |
| 73 | + // 订单编号 | |
| 74 | + detail.setOrderId(100L); | |
| 75 | + return success(detail); | |
| 76 | + } | |
| 77 | + | |
| 78 | +} | ... | ... |
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 { |
| 25 | 25 | @Schema(description = "活动结束时间", required = true) |
| 26 | 26 | private LocalDateTime endTime; |
| 27 | 27 | |
| 28 | + @Schema(description = "拼团人数", required = true, example = "3") | |
| 29 | + private Integer userSize; | |
| 30 | + | |
| 31 | + @Schema(description = "成功的拼团数量", required = true, example = "100") | |
| 32 | + private Integer successCount; | |
| 33 | + | |
| 28 | 34 | @Schema(description = "商品 SPU 编号", required = true, example = "2048") |
| 29 | 35 | private Long spuId; |
| 30 | 36 | |
| 31 | 37 | @Schema(description = "商品信息数组", required = true) |
| 32 | 38 | private List<Product> products; |
| 33 | 39 | |
| 34 | - @Schema(description = "成功的拼团记录", required = true) | |
| 35 | - private List<Record> successRecords; | |
| 36 | - | |
| 37 | - @Schema(description = "进行中的拼团记录", required = true) | |
| 38 | - private List<Record> runningRecords; | |
| 39 | - | |
| 40 | 40 | @Schema(description = "商品信息") |
| 41 | 41 | @Data |
| 42 | 42 | public static class Product { |
| ... | ... | @@ -55,13 +55,4 @@ public class AppCombinationActivityDetailRespVO { |
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - @Schema(description = "拼团记录") | |
| 59 | - @Data | |
| 60 | - public static class Record { | |
| 61 | - | |
| 62 | - @Schema(description = "拼团记录编号", required = true, example = "1024") | |
| 63 | - private Long id; | |
| 64 | - | |
| 65 | - } | |
| 66 | - | |
| 67 | 58 | } | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +@Schema(description = "用户 App - 拼团记录详细 Response VO") | |
| 9 | +@Data | |
| 10 | +public class AppCombinationRecordDetailRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "团长的拼团记录", required = true) | |
| 13 | + private AppCombinationRecordSimpleRespVO headRecord; | |
| 14 | + | |
| 15 | + @Schema(description = "成员的拼团记录", required = true) | |
| 16 | + private List<AppCombinationRecordSimpleRespVO> memberRecords; | |
| 17 | + | |
| 18 | + @Schema(description = "当前用户参团记录对应的订单编号", required = true, example = "1024") // 如果没参团,返回 null | |
| 19 | + private Long orderId; | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import java.util.Date; | |
| 7 | + | |
| 8 | +@Schema(description = "用户 App - 拼团记录精简 Response VO") | |
| 9 | +@Data | |
| 10 | +public class AppCombinationRecordSimpleRespVO { | |
| 11 | + | |
| 12 | + @Schema(description = "拼团记录编号", required = true, example = "1024") | |
| 13 | + private Long id; | |
| 14 | + | |
| 15 | + @Schema(description = "用户昵称", required = true, example = "1024") | |
| 16 | + private String nickname; | |
| 17 | + | |
| 18 | + @Schema(description = "用户头像", required = true, example = "1024") | |
| 19 | + private String avatar; | |
| 20 | + | |
| 21 | + @Schema(description = "过期时间", required = true) | |
| 22 | + private Date expireTime; | |
| 23 | + | |
| 24 | + @Schema(description = "可参团人数", required = true, example = "10") | |
| 25 | + private Integer userSize; | |
| 26 | + | |
| 27 | + @Schema(description = "已参团人数", required = true, example = "5") | |
| 28 | + private Integer userCount; | |
| 29 | + | |
| 30 | +} | ... | ... |
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 { |
| 27 | 27 | @Schema(description = "活动结束时间", required = true) |
| 28 | 28 | private LocalDateTime endTime; |
| 29 | 29 | |
| 30 | - | |
| 31 | - private Long successGruopCount; | |
| 32 | - | |
| 33 | 30 | @Schema(description = "商品 SPU 编号", required = true, example = "2048") |
| 34 | 31 | private Long spuId; |
| 35 | 32 | ... | ... |