Merge branch 'feature/mall_product' of https://gitee.com/zhijiantianya/ruoyi-vue-pro

 Conflicts:
	yudao-module-mall/yudao-module-promotion-api/src/main/java/cn/iocoder/yudao/module/promotion/enums/ErrorCodeConstants.java
	yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/combination/AppCombinationRecordController.java
	yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/ErrorCodeConstants.java
	yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java
	yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/ErrorCodeConstants.java
This commit is contained in:
YunaiV
2023-09-11 16:19:55 +08:00
153 changed files with 4837 additions and 647 deletions

View File

@@ -0,0 +1,18 @@
package cn.iocoder.yudao.module.promotion.api.bargain;
/**
* 砍价活动 Api 接口
*
* @author HUIHUI
*/
public interface BargainActivityApi {
/**
* 更新砍价活动库存
*
* @param activityId 砍价活动编号
* @param count 购买数量
*/
void updateBargainActivityStock(Long activityId, Integer count);
}

View File

@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.promotion.api.bargain.dto;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
// TODO @芋艿:这块要在看看
@@ -40,17 +39,7 @@ public class BargainRecordCreateReqDTO {
*/
@NotNull(message = "订单编号不能为空")
private Long orderId;
// TODO @puhui999spuName、picUrl、 之类字段不用传递;
/**
* 商品名字
*/
@NotEmpty(message = "商品名字不能为空")
private String spuName;
/**
* 商品图片
*/
@NotEmpty(message = "商品图片不能为空")
private String picUrl;
/**
* 砍价商品单价
*/
@@ -61,17 +50,7 @@ public class BargainRecordCreateReqDTO {
*/
@NotNull(message = "商品原价不能为空")
private Integer price;
// TODO @puhui999nickname、avatar 不用传递,去查询;
/**
* 用户昵称
*/
@NotEmpty(message = "用户昵称不能为空")
private String nickname;
/**
* 用户头像
*/
@NotEmpty(message = "用户头像不能为空")
private String avatar;
/**
* 开团状态:进行中 砍价成功 砍价失败
*/

View File

@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.promotion.api.combination;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordCreateReqDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordRespDTO;
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationRecordUpdateStatusReqDTO;
import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.List;
// TODO @芋艿:后面也再撸撸这几个接口
@@ -51,13 +51,29 @@ public interface CombinationRecordApi {
*/
void validateCombinationLimitCount(Long activityId, Integer count, Integer sumCount);
// TODO @puhui999是不是搞成具体的方法拼团成功拼团失败这种方法
/**
* 更新拼团状态为成功
*
* @param userId 用户编号
* @param orderId 订单编号
*/
void updateRecordStatusToSuccess(Long userId, Long orderId);
/**
* 更新开团记录状态
* 更新拼团状态为失败
*
* @param reqDTO 请求 DTO
* @param userId 用户编号
* @param orderId 订单编号
*/
void updateCombinationRecordStatus(CombinationRecordUpdateStatusReqDTO reqDTO);
void updateRecordStatusToFailed(Long userId, Long orderId);
/**
* 更新拼团状态为 进行中
*
* @param userId 用户编号
* @param orderId 订单编号
* @param startTime 开始时间
*/
void updateRecordStatusToInProgress(Long userId, Long orderId, LocalDateTime startTime);
}

View File

@@ -1,39 +0,0 @@
package cn.iocoder.yudao.module.promotion.api.combination.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
/**
* 拼团记录的更新状态 Request DTO
*
* @author HUIHUI
*/
@Data
public class CombinationRecordUpdateStatusReqDTO {
/**
* 用户编号
*/
@NotNull(message = "用户编号不能为空")
private Long userId;
/**
* 订单编号
*/
@NotNull(message = "订单编号不能为空")
private Long orderId;
/**
* 开团状态:正在开团 拼团成功 拼团失败
*/
@NotNull(message = "开团状态不能为空")
private Integer status;
/**
* 团开始时间
*/
private LocalDateTime startTime;
}

View File

@@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.promotion.api.seckill;
import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillActivityUpdateStockReqDTO;
/**
* 秒杀活动 API 接口
*
* @author HUIHUI
*/
public interface SeckillActivityApi {
/**
* 更新秒杀库存
*
* @param updateStockReqDTO 请求
*/
void updateSeckillStock(SeckillActivityUpdateStockReqDTO updateStockReqDTO);
}

View File

@@ -0,0 +1,50 @@
package cn.iocoder.yudao.module.promotion.api.seckill.dto;
import lombok.Data;
import java.util.List;
/**
* 更新秒杀库存 request DTO
*
* @author HUIHUI
*/
@Data
public class SeckillActivityUpdateStockReqDTO {
// TODO @puhui999参数校验
// TODO @puhui999秒杀的话一次只能购买一种商品哈不能多个哈
/**
* 活动编号
*/
private Long activityId;
/**
* 总购买数量
*/
private Integer count;
/**
* 活动商品
*/
private List<Item> items;
@Data
public static class Item {
/**
* SPU 编号
*/
private Long spuId;
/**
* SKU 编号
*/
private Long skuId;
/**
* 购买数量
*/
private Integer count;
}
}

View File

@@ -55,6 +55,7 @@ public interface ErrorCodeConstants {
ErrorCode SECKILL_ACTIVITY_UPDATE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_008_003, "秒杀活动已关闭,不能修改");
ErrorCode SECKILL_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED_OR_END = new ErrorCode(1_013_008_004, "秒杀活动未关闭或未结束,不能删除");
ErrorCode SECKILL_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED = new ErrorCode(1_013_008_005, "秒杀活动已关闭,不能重复关闭");
ErrorCode SECKILL_ACTIVITY_UPDATE_STOCK_FAIL = new ErrorCode(1013008006, "更新秒杀活动库存失败,原因秒杀库存不足");
// ========== 秒杀时段 1-013-009-000 ==========
ErrorCode SECKILL_CONFIG_NOT_EXISTS = new ErrorCode(1_013_009_000, "秒杀时段不存在");