Commit 8ec373388250cf26b16094de895e5a414490ed3b
1 parent
af9334c9
mall + trade:mock 拼团记录列表的接口
Showing
5 changed files
with
54 additions
and
13 deletions
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/DateUtils.java
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| 1 | 1 | package cn.iocoder.yudao.module.promotion.controller.app.combination; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | +import cn.iocoder.yudao.framework.common.util.date.DateUtils; | |
| 4 | 5 | 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 cn.iocoder.yudao.module.promotion.controller.app.combination.vo.record.AppCombinationRecordRespVO; | |
| 6 | 7 | import io.swagger.v3.oas.annotations.Operation; |
| 7 | 8 | import io.swagger.v3.oas.annotations.Parameter; |
| 8 | 9 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam; |
| 13 | 14 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 15 | |
| 15 | 16 | import javax.validation.constraints.Max; |
| 17 | +import java.time.Duration; | |
| 16 | 18 | import java.util.ArrayList; |
| 17 | 19 | import java.util.Date; |
| 18 | 20 | import java.util.List; |
| ... | ... | @@ -27,18 +29,23 @@ public class AppCombinationRecordController { |
| 27 | 29 | |
| 28 | 30 | @GetMapping("/get-head-list") |
| 29 | 31 | @Operation(summary = "获得最近 n 条拼团记录(团长发起的)") |
| 30 | - public CommonResult<List<AppCombinationRecordSimpleRespVO>> getHeadCombinationRecordList( | |
| 32 | + // TODO @芋艿:注解要补全 | |
| 33 | + public CommonResult<List<AppCombinationRecordRespVO>> getHeadCombinationRecordList( | |
| 34 | + @RequestParam(value = "activityId", required = false) Long activityId, | |
| 31 | 35 | @RequestParam("status") Integer status, |
| 32 | 36 | @RequestParam(value = "count", defaultValue = "20") @Max(20) Integer count) { |
| 33 | - List<AppCombinationRecordSimpleRespVO> list = new ArrayList<>(); | |
| 37 | + List<AppCombinationRecordRespVO> list = new ArrayList<>(); | |
| 34 | 38 | for (int i = 1; i <= count; i++) { |
| 35 | - AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); | |
| 39 | + AppCombinationRecordRespVO record = new AppCombinationRecordRespVO(); | |
| 36 | 40 | record.setId((long) i); |
| 37 | 41 | record.setNickname("用户" + i); |
| 38 | 42 | record.setAvatar("头像" + i); |
| 39 | 43 | record.setExpireTime(new Date()); |
| 40 | 44 | record.setUserSize(10); |
| 41 | 45 | record.setUserCount(i); |
| 46 | + record.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | |
| 47 | + record.setActivityId(1L); | |
| 48 | + record.setActivityName("活动:" + i); | |
| 42 | 49 | list.add(record); |
| 43 | 50 | } |
| 44 | 51 | return success(list); |
| ... | ... | @@ -50,23 +57,29 @@ public class AppCombinationRecordController { |
| 50 | 57 | public CommonResult<AppCombinationRecordDetailRespVO> getCombinationRecordDetail(@RequestParam("id") Long id) { |
| 51 | 58 | AppCombinationRecordDetailRespVO detail = new AppCombinationRecordDetailRespVO(); |
| 52 | 59 | // 团长 |
| 53 | - AppCombinationRecordSimpleRespVO headRecord = new AppCombinationRecordSimpleRespVO(); | |
| 60 | + AppCombinationRecordRespVO headRecord = new AppCombinationRecordRespVO(); | |
| 54 | 61 | headRecord.setId(1L); |
| 55 | 62 | headRecord.setNickname("用户" + 1); |
| 56 | 63 | headRecord.setAvatar("头像" + 1); |
| 57 | - headRecord.setExpireTime(new Date()); | |
| 64 | + headRecord.setExpireTime(DateUtils.addTime(Duration.ofDays(1))); | |
| 58 | 65 | headRecord.setUserSize(10); |
| 59 | 66 | headRecord.setUserCount(3); |
| 67 | + headRecord.setStatus(1); | |
| 68 | + headRecord.setActivityId(10L); | |
| 69 | + headRecord.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); | |
| 70 | + headRecord.setCombinationPrice(100); | |
| 71 | + detail.setHeadRecord(headRecord); | |
| 60 | 72 | // 团员 |
| 61 | - List<AppCombinationRecordSimpleRespVO> list = new ArrayList<>(); | |
| 73 | + List<AppCombinationRecordRespVO> list = new ArrayList<>(); | |
| 62 | 74 | for (int i = 1; i <= 2; i++) { |
| 63 | - AppCombinationRecordSimpleRespVO record = new AppCombinationRecordSimpleRespVO(); | |
| 75 | + AppCombinationRecordRespVO record = new AppCombinationRecordRespVO(); | |
| 64 | 76 | record.setId((long) i); |
| 65 | 77 | record.setNickname("用户" + i); |
| 66 | 78 | record.setAvatar("头像" + i); |
| 67 | 79 | record.setExpireTime(new Date()); |
| 68 | 80 | record.setUserSize(10); |
| 69 | 81 | record.setUserCount(i); |
| 82 | + record.setStatus(1); | |
| 70 | 83 | list.add(record); |
| 71 | 84 | } |
| 72 | 85 | detail.setMemberRecords(list); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordDetailRespVO.java
| ... | ... | @@ -10,10 +10,10 @@ import java.util.List; |
| 10 | 10 | public class AppCombinationRecordDetailRespVO { |
| 11 | 11 | |
| 12 | 12 | @Schema(description = "团长的拼团记录", required = true) |
| 13 | - private AppCombinationRecordSimpleRespVO headRecord; | |
| 13 | + private AppCombinationRecordRespVO headRecord; | |
| 14 | 14 | |
| 15 | 15 | @Schema(description = "成员的拼团记录", required = true) |
| 16 | - private List<AppCombinationRecordSimpleRespVO> memberRecords; | |
| 16 | + private List<AppCombinationRecordRespVO> memberRecords; | |
| 17 | 17 | |
| 18 | 18 | @Schema(description = "当前用户参团记录对应的订单编号", required = true, example = "1024") // 如果没参团,返回 null |
| 19 | 19 | private Long orderId; | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordSimpleRespVO.java renamed to yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordRespVO.java
| ... | ... | @@ -5,13 +5,16 @@ import lombok.Data; |
| 5 | 5 | |
| 6 | 6 | import java.util.Date; |
| 7 | 7 | |
| 8 | -@Schema(description = "用户 App - 拼团记录精简 Response VO") | |
| 8 | +@Schema(description = "用户 App - 拼团记录 Response VO") | |
| 9 | 9 | @Data |
| 10 | -public class AppCombinationRecordSimpleRespVO { | |
| 10 | +public class AppCombinationRecordRespVO { | |
| 11 | 11 | |
| 12 | 12 | @Schema(description = "拼团记录编号", required = true, example = "1024") |
| 13 | 13 | private Long id; |
| 14 | 14 | |
| 15 | + @Schema(description = "拼团活动编号", required = true, example = "1024") | |
| 16 | + private Long activityId; | |
| 17 | + | |
| 15 | 18 | @Schema(description = "用户昵称", required = true, example = "1024") |
| 16 | 19 | private String nickname; |
| 17 | 20 | |
| ... | ... | @@ -27,4 +30,18 @@ public class AppCombinationRecordSimpleRespVO { |
| 27 | 30 | @Schema(description = "已参团人数", required = true, example = "5") |
| 28 | 31 | private Integer userCount; |
| 29 | 32 | |
| 33 | + @Schema(description = "拼团状态", required = true, example = "1") | |
| 34 | + private Integer status; | |
| 35 | + | |
| 36 | + @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") | |
| 37 | + private String picUrl; | |
| 38 | + | |
| 39 | + @Schema(description = "拼团金额,单位:分", required = true, example = "100") | |
| 40 | + private Integer combinationPrice; | |
| 41 | + | |
| 42 | + // ========== 获得最近 n 条拼团记录(团长发起的)返回的字段 ========== | |
| 43 | + | |
| 44 | + @Schema(description = "拼团活动名字", required = true, example = "1024") | |
| 45 | + private String activityName; | |
| 46 | + | |
| 30 | 47 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java
| ... | ... | @@ -18,6 +18,7 @@ public class AppTradeOrderSettlementReqVO { |
| 18 | 18 | |
| 19 | 19 | @NotNull(message = "交易类型不能为空") |
| 20 | 20 | @InEnum(value = TradeOrderTypeEnum.class, message = "交易类型必须是 {value}") |
| 21 | + @Deprecated // TODO 芋艿:后续干掉这个字段,对于前端不需要关注这个 | |
| 21 | 22 | private Integer type; |
| 22 | 23 | |
| 23 | 24 | @Schema(description = "商品项数组", required = true) |
| ... | ... | @@ -30,6 +31,17 @@ public class AppTradeOrderSettlementReqVO { |
| 30 | 31 | @Schema(description = "优惠劵编号", example = "1024") |
| 31 | 32 | private Long couponId; |
| 32 | 33 | |
| 34 | + // ========== 秒杀活动相关字段 ========== | |
| 35 | + @Schema(description = "秒杀活动编号", example = "1024") | |
| 36 | + private Long seckillActivityId; | |
| 37 | + | |
| 38 | + // ========== 拼团活动相关字段 ========== | |
| 39 | + @Schema(description = "拼团活动编号", example = "1024") | |
| 40 | + private Long combinationActivityId; | |
| 41 | + | |
| 42 | + @Schema(description = "拼团团长编号", example = "2048") | |
| 43 | + private Long combinationHeadId; | |
| 44 | + | |
| 33 | 45 | @Data |
| 34 | 46 | @Schema(description = "用户 App - 商品项") |
| 35 | 47 | @Valid | ... | ... |