Commit 5b324f90a4d5a1d544eae275b0666aa327c2e272
1 parent
8ec37338
mall + promotion:mock 拼团活动列表
Showing
4 changed files
with
66 additions
and
7 deletions
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationActivityController.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.pojo.PageParam; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | 6 | import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.activity.AppCombinationActivityDetailRespVO; |
| 7 | +import cn.iocoder.yudao.module.promotion.controller.app.combination.vo.activity.AppCombinationActivityPageItemRespVO; | |
| 5 | 8 | import io.swagger.v3.oas.annotations.Operation; |
| 6 | 9 | import io.swagger.v3.oas.annotations.Parameter; |
| 7 | 10 | import io.swagger.v3.oas.annotations.tags.Tag; |
| ... | ... | @@ -23,10 +26,37 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 23 | 26 | @Validated |
| 24 | 27 | public class AppCombinationActivityController { |
| 25 | 28 | |
| 29 | + @GetMapping("/page") | |
| 30 | + @Operation(summary = "获得拼团活动分页") | |
| 31 | + public CommonResult<PageResult<AppCombinationActivityPageItemRespVO>> getCombinationActivityPage(PageParam pageParam) { | |
| 32 | + List<AppCombinationActivityPageItemRespVO> activityList = new ArrayList<>(); | |
| 33 | + AppCombinationActivityPageItemRespVO activity1 = new AppCombinationActivityPageItemRespVO(); | |
| 34 | + activity1.setId(1L); | |
| 35 | + activity1.setName("618 大拼团"); | |
| 36 | + activity1.setUserSize(3); | |
| 37 | + activity1.setSpuId(2048L); | |
| 38 | + activity1.setPicUrl("商品图片地址"); | |
| 39 | + activity1.setMarketPrice(50); | |
| 40 | + activity1.setCombinationPrice(100); | |
| 41 | + activityList.add(activity1); | |
| 42 | + | |
| 43 | + AppCombinationActivityPageItemRespVO activity2 = new AppCombinationActivityPageItemRespVO(); | |
| 44 | + activity2.setId(2L); | |
| 45 | + activity2.setName("双十一拼团"); | |
| 46 | + activity2.setUserSize(5); | |
| 47 | + activity2.setSpuId(4096L); | |
| 48 | + activity2.setPicUrl("商品图片地址"); | |
| 49 | + activity2.setMarketPrice(100); | |
| 50 | + activity2.setCombinationPrice(200); | |
| 51 | + activityList.add(activity2); | |
| 52 | + | |
| 53 | + return success(new PageResult<>(activityList, 2L)); | |
| 54 | + } | |
| 55 | + | |
| 26 | 56 | @GetMapping("/get-detail") |
| 27 | 57 | @Operation(summary = "获得拼团活动明细") |
| 28 | 58 | @Parameter(name = "id", description = "活动编号", required = true, example = "1024") |
| 29 | - public CommonResult<AppCombinationActivityDetailRespVO> getCombinationActivity(@RequestParam("id") Long id) { | |
| 59 | + public CommonResult<AppCombinationActivityDetailRespVO> getCombinationActivityDetail(@RequestParam("id") Long id) { | |
| 30 | 60 | // TODO 芋艿:如果禁用的时候,需要抛出异常; |
| 31 | 61 | AppCombinationActivityDetailRespVO obj = new AppCombinationActivityDetailRespVO(); |
| 32 | 62 | // 设置其属性的值 | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
| ... | ... | @@ -45,7 +45,7 @@ public class AppCombinationRecordController { |
| 45 | 45 | record.setUserCount(i); |
| 46 | 46 | record.setPicUrl("https://demo26.crmeb.net/uploads/attach/2021/11/15/a79f5d2ea6bf0c3c11b2127332dfe2df.jpg"); |
| 47 | 47 | record.setActivityId(1L); |
| 48 | - record.setActivityName("活动:" + i); | |
| 48 | + record.setSpuName("活动:" + i); | |
| 49 | 49 | list.add(record); |
| 50 | 50 | } |
| 51 | 51 | return success(list); | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/activity/AppCombinationActivityPageItemRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.promotion.controller.app.combination.vo.activity; | |
| 2 | + | |
| 3 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +@Schema(description = "用户 App - 拼团活动分页项 Response VO") | |
| 7 | +@Data | |
| 8 | +public class AppCombinationActivityPageItemRespVO { | |
| 9 | + | |
| 10 | + @Schema(description = "拼团活动编号", required = true, example = "1024") | |
| 11 | + private Long id; | |
| 12 | + | |
| 13 | + @Schema(description = "拼团活动名称", required = true, example = "618 大拼团") | |
| 14 | + private String name; | |
| 15 | + | |
| 16 | + @Schema(description = "拼团人数", required = true, example = "3") | |
| 17 | + private Integer userSize; | |
| 18 | + | |
| 19 | + @Schema(description = "商品 SPU 编号", required = true, example = "2048") | |
| 20 | + private Long spuId; | |
| 21 | + | |
| 22 | + @Schema(description = "商品图片", required = true, example = "4096") // 从 SPU 的 picUrl 读取 | |
| 23 | + private String picUrl; | |
| 24 | + | |
| 25 | + @Schema(description = "商品市场价,单位:分", required = true, example = "50") // 从 SPU 的 marketPrice 读取 | |
| 26 | + private Integer marketPrice; | |
| 27 | + | |
| 28 | + @Schema(description = "拼团金额,单位:分", required = true, example = "100") // 从拼团商品里取最低价 | |
| 29 | + private Integer combinationPrice; | |
| 30 | + | |
| 31 | +} | ... | ... |
yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/vo/record/AppCombinationRecordRespVO.java
| ... | ... | @@ -33,15 +33,13 @@ public class AppCombinationRecordRespVO { |
| 33 | 33 | @Schema(description = "拼团状态", required = true, example = "1") |
| 34 | 34 | private Integer status; |
| 35 | 35 | |
| 36 | + @Schema(description = "商品名字", required = true, example = "我是大黄豆") | |
| 37 | + private String spuName; | |
| 38 | + | |
| 36 | 39 | @Schema(description = "商品图片", required = true, example = "https://www.iocoder.cn/1.png") |
| 37 | 40 | private String picUrl; |
| 38 | 41 | |
| 39 | 42 | @Schema(description = "拼团金额,单位:分", required = true, example = "100") |
| 40 | 43 | private Integer combinationPrice; |
| 41 | 44 | |
| 42 | - // ========== 获得最近 n 条拼团记录(团长发起的)返回的字段 ========== | |
| 43 | - | |
| 44 | - @Schema(description = "拼团活动名字", required = true, example = "1024") | |
| 45 | - private String activityName; | |
| 46 | - | |
| 47 | 45 | } | ... | ... |