营销活动+订单:完善大部分 TODO 提到的问题

This commit is contained in:
puhui999
2023-09-08 00:35:54 +08:00
parent 2591ab5d36
commit 0e8755972c
19 changed files with 381 additions and 45 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

@ -0,0 +1,20 @@
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,46 @@
package cn.iocoder.yudao.module.promotion.api.seckill.dto;
import lombok.Data;
import java.util.List;
/**
* 更新秒杀库存 request DTO
*
* @author HUIHUI
*/
@Data
public class SeckillActivityUpdateStockReqDTO {
/**
* 活动编号
*/
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(1013008003, "秒杀活动已关闭,不能修改");
ErrorCode SECKILL_ACTIVITY_DELETE_FAIL_STATUS_NOT_CLOSED_OR_END = new ErrorCode(1013008004, "秒杀活动未关闭或未结束,不能删除");
ErrorCode SECKILL_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED = new ErrorCode(1013008005, "秒杀活动已关闭,不能重复关闭");
ErrorCode SECKILL_ACTIVITY_UPDATE_STOCK_FAIL = new ErrorCode(1013008006, "更新秒杀活动库存失败,原因秒杀库存不足");
// ========== 秒杀时段 1013009000 ==========
ErrorCode SECKILL_CONFIG_NOT_EXISTS = new ErrorCode(1013009000, "秒杀时段不存在");