diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponController.java index a0804079b..481ced4b4 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponController.java @@ -20,7 +20,7 @@ public class AppCouponController { // TODO 芋艿:待实现 @PostMapping("/take") - @Operation(description = "领取优惠劵") + @Operation(summary = "领取优惠劵") public CommonResult takeCoupon(@RequestBody AppCouponTemplatePageReqVO pageReqVO) { return success(1L); } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponTemplateController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponTemplateController.java index f08bd0d74..8c6521803 100755 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponTemplateController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/coupon/AppCouponTemplateController.java @@ -34,7 +34,7 @@ public class AppCouponTemplateController { // TODO 芋艿:待实现 @GetMapping("/list") - @Operation(description = "获得优惠劵模版列表") // 目前主要给商品详情使用 + @Operation(summary = "获得优惠劵模版列表") // 目前主要给商品详情使用 @Parameters({ @Parameter(name = "spuId", description = "商品 SPU 编号", required = true), @Parameter(name = "useType", description = "使用类型"), @@ -76,7 +76,7 @@ public class AppCouponTemplateController { // TODO 芋艿:待实现 @GetMapping("/page") - @Operation(description = "获得优惠劵模版分页") + @Operation(summary = "获得优惠劵模版分页") public CommonResult> getCouponTemplatePage(AppCouponTemplatePageReqVO pageReqVO) { return null; } diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java new file mode 100644 index 000000000..22d4f76bd --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/AppSeckillActivityController.java @@ -0,0 +1,67 @@ +package cn.iocoder.yudao.module.promotion.controller.app.seckill; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.promotion.controller.app.seckill.vo.AppSeckillActivitiDetailRespVO; +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 java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "用户 App - 秒杀活动") +@RestController +@RequestMapping("/promotion/seckill-activity") +@Validated +public class AppSeckillActivityController { + + @GetMapping("/get-detail") + @Operation(summary = "获得秒杀活动明细") + @Parameter(name = "id", description = "活动编号", required = true, example = "1024") + public CommonResult getSeckillActivity(@RequestParam("id") Long id) { + // TODO 芋艿:如果禁用的时候,需要抛出异常; + AppSeckillActivitiDetailRespVO obj = new AppSeckillActivitiDetailRespVO(); + // 设置其属性的值 + obj.setId(id); + obj.setName("晚九点限时秒杀"); + obj.setStatus(1); + obj.setStartTime(LocalDateTime.of(2023, 6, 10, 0, 0, 0)); + obj.setEndTime(LocalDateTime.of(2023, 6, 10, 23, 59, 0)); + obj.setSpuId(633L); + // 创建一个Product对象的列表 + List productList = new ArrayList<>(); + // 创建三个新的Product对象并设置其属性的值 + AppSeckillActivitiDetailRespVO.Product product1 = new AppSeckillActivitiDetailRespVO.Product(); + product1.setSkuId(4096L); + product1.setSeckillPrice(100); + product1.setQuota(50); + // 将第一个Product对象添加到列表中 + productList.add(product1); + // 创建第二个Product对象并设置其属性的值 + AppSeckillActivitiDetailRespVO.Product product2 = new AppSeckillActivitiDetailRespVO.Product(); + product2.setSkuId(4097L); + product2.setSeckillPrice(200); + product2.setQuota(100); + // 将第二个Product对象添加到列表中 + productList.add(product2); + // 创建第三个Product对象并设置其属性的值 + AppSeckillActivitiDetailRespVO.Product product3 = new AppSeckillActivitiDetailRespVO.Product(); + product3.setSkuId(4098L); + product3.setSeckillPrice(300); + product3.setQuota(150); + // 将第三个Product对象添加到列表中 + productList.add(product3); + // 将Product列表设置为对象的属性值 + obj.setProducts(productList); + return success(obj); + } + +} 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 new file mode 100644 index 000000000..62cdf9b4f --- /dev/null +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/seckill/vo/AppSeckillActivitiDetailRespVO.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.promotion.controller.app.seckill.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Schema(description = "用户 App - 秒杀活动 Response VO") +@Data +public class AppSeckillActivitiDetailRespVO { + + @Schema(description = "秒杀活动编号", required = true, example = "1024") + private Long id; + + @Schema(description = "秒杀活动名称", required = true, example = "晚九点限时秒杀") + private String name; + + @Schema(description = "活动状态", required = true, example = "1") + private Integer status; + + // TODO @芋艿:开始时间、结束时间,要和场次结合起来;就是要算到当前场次,是几点哈; + + @Schema(description = "活动开始时间", required = true) + private LocalDateTime startTime; + + @Schema(description = "活动结束时间", required = true) + private LocalDateTime endTime; + + @Schema(description = "商品 SPU 编号", required = true, example = "2048") + private Long spuId; + + @Schema(description = "商品 SPU 名字", required = true) + private List products; + + @Schema(description = "商品信息") + @Data + public static class Product { + + @Schema(description = "商品 SKU 编号", required = true, example = "4096") + private Long skuId; + + @Schema(description = "秒杀金额,单位:分", required = true, example = "100") + private Integer seckillPrice; + + @Schema(description = "秒杀限量库存", required = true, example = "50") + private Integer quota; + + } + +} diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillActivityDO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillActivityDO.java index 1d3b6da27..2a0dcd70b 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillActivityDO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillActivityDO.java @@ -37,7 +37,7 @@ public class SeckillActivityDO extends BaseDO { private String name; /** * 活动状态 - *

+ * * 枚举 {@link PromotionActivityStatusEnum 对应的类} */ private Integer status; diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillProductDO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillProductDO.java index 3783d6dda..2adc0acfd 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillProductDO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/seckill/seckillactivity/SeckillProductDO.java @@ -53,6 +53,7 @@ public class SeckillProductDO extends BaseDO { */ private Integer seckillPrice; + // TODO @芋艿:改成 quota 限量库存;每次购买时,需要减小; /** * 秒杀库存 */ @@ -61,5 +62,6 @@ public class SeckillProductDO extends BaseDO { /** * 每人限购 */ - private Integer limitBuyCount; -} \ No newline at end of file + private Integer limitCount; + +} diff --git a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java index e3008fdd6..49bc63986 100644 --- a/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java +++ b/yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java @@ -64,7 +64,7 @@ public class AppTradeOrderController { } @PostMapping("/update-paid") - @Operation(description = "更新订单为已支付") // 由 pay-module 支付服务,进行回调,可见 PayNotifyJob + @Operation(summary = "更新订单为已支付") // 由 pay-module 支付服务,进行回调,可见 PayNotifyJob public CommonResult updateOrderPaid(@RequestBody PayOrderNotifyReqDTO notifyReqDTO) { tradeOrderService.updateOrderPaid(Long.valueOf(notifyReqDTO.getMerchantOrderId()), notifyReqDTO.getPayOrderId());