trade:启动成功
parent
537d3421a8
commit
162f34a6c4
|
@ -1,18 +1,28 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.bargain;
|
||||
|
||||
/**
|
||||
* 砍价活动 Api 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
// TODO 芋艿:commonresult
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 砍价活动")
|
||||
public interface BargainActivityApi {
|
||||
|
||||
/**
|
||||
* 更新砍价活动库存
|
||||
*
|
||||
* @param id 砍价活动编号
|
||||
* @param count 购买数量
|
||||
*/
|
||||
void updateBargainActivityStock(Long id, Integer count);
|
||||
String PREFIX = ApiConstants.PREFIX + "/bargain-activity";
|
||||
|
||||
@PutMapping(PREFIX + "/update-stock")
|
||||
@Operation(summary = "更新砍价活动库存")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "砍价活动编号", required = true, example = "1024"),
|
||||
@Parameter(name = "count", description = "购买数量", required = true, example = "1"),
|
||||
})
|
||||
void updateBargainActivityStock(@RequestParam("id") Long id,
|
||||
@RequestParam("count") Integer count);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,34 +1,40 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.bargain;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.api.bargain.dto.BargainValidateJoinRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 砍价记录 API 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 砍价记录")
|
||||
public interface BargainRecordApi {
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否参与砍价活动
|
||||
* <p>
|
||||
* 如果校验失败,则抛出业务异常
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param bargainRecordId 砍价活动编号
|
||||
* @param skuId SKU 编号
|
||||
* @return 砍价信息
|
||||
*/
|
||||
BargainValidateJoinRespDTO validateJoinBargain(Long userId, Long bargainRecordId, Long skuId);
|
||||
String PREFIX = ApiConstants.PREFIX + "/bargain-record";
|
||||
|
||||
/**
|
||||
* 更新砍价记录的订单编号
|
||||
*
|
||||
* 在砍价成功后,用户发起订单后,会记录该订单编号
|
||||
*
|
||||
* @param id 砍价记录编号
|
||||
* @param orderId 订单编号
|
||||
*/
|
||||
void updateBargainRecordOrderId(Long id, Long orderId);
|
||||
@GetMapping(PREFIX + "/validate-join")
|
||||
@Operation(summary = "【下单前】校验是否参与砍价活动") // 如果校验失败,则抛出业务异常
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024"),
|
||||
@Parameter(name = "bargainRecordId", description = "砍价记录编号", required = true, example = "2048"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "4096"),
|
||||
})
|
||||
BargainValidateJoinRespDTO validateJoinBargain(@RequestParam("userId") Long userId,
|
||||
@RequestParam("bargainRecordId") Long bargainRecordId,
|
||||
@RequestParam("skuId") Long skuId);
|
||||
|
||||
@PutMapping(PREFIX + "/update-order-id")
|
||||
@Operation(summary = "更新砍价记录的订单编号") // 在砍价成功后,用户发起订单后,会记录该订单编号
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "砍价记录编号", required = true, example = "1024"),
|
||||
@Parameter(name = "orderId", description = "订单编号", required = true, example = "2048"),
|
||||
})
|
||||
void updateBargainRecordOrderId(@RequestParam("id") Long id,
|
||||
@RequestParam("oderId") Long orderId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.combination;
|
||||
|
||||
/**
|
||||
* 拼团活动 Api 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface CombinationActivityApi {
|
||||
|
||||
}
|
|
@ -3,51 +3,52 @@ 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.CombinationRecordCreateRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.combination.dto.CombinationValidateJoinRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 拼团记录 API 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 拼团记录")
|
||||
public interface CombinationRecordApi {
|
||||
|
||||
/**
|
||||
* 校验是否满足拼团条件
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param activityId 活动编号
|
||||
* @param headId 团长编号
|
||||
* @param skuId sku 编号
|
||||
* @param count 数量
|
||||
*/
|
||||
void validateCombinationRecord(Long userId, Long activityId, Long headId, Long skuId, Integer count);
|
||||
String PREFIX = ApiConstants.PREFIX + "/combination-record";
|
||||
|
||||
/**
|
||||
* 创建开团记录
|
||||
*
|
||||
* @param reqDTO 请求 DTO
|
||||
* @return 拼团信息
|
||||
*/
|
||||
CombinationRecordCreateRespDTO createCombinationRecord(@Valid CombinationRecordCreateReqDTO reqDTO);
|
||||
@GetMapping(PREFIX + "/validate")
|
||||
@Operation(summary = "校验是否满足拼团条件")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024"),
|
||||
@Parameter(name = "activityId", description = "活动编号", required = true, example = "2048"),
|
||||
@Parameter(name = "headId", description = "团长编号", required = true, example = "4096"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "8192"),
|
||||
@Parameter(name = "count", description = "数量", required = true, example = "1"),
|
||||
})
|
||||
void validateCombinationRecord(@RequestParam("userId") Long userId,
|
||||
@RequestParam("activityId") Long activityId,
|
||||
@RequestParam("headId") Long headId,
|
||||
@RequestParam("skuId") Long skuId,
|
||||
@RequestParam("count") Integer count);
|
||||
|
||||
/**
|
||||
* 查询拼团记录是否成功
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param orderId 订单编号
|
||||
* @return 拼团是否成功
|
||||
*/
|
||||
boolean isCombinationRecordSuccess(Long userId, Long orderId);
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建开团记录")
|
||||
CombinationRecordCreateRespDTO createCombinationRecord(@RequestBody @Valid CombinationRecordCreateReqDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 更新拼团状态为【失败】
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param orderId 订单编号
|
||||
*/
|
||||
void updateRecordStatusToFailed(Long userId, Long orderId);
|
||||
@GetMapping("/is-success")
|
||||
@Operation(summary = "查询拼团记录是否成功")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024"),
|
||||
@Parameter(name = "orderId", description = "订单编号", required = true, example = "2048"),
|
||||
})
|
||||
boolean isCombinationRecordSuccess(@RequestParam("userId") Long userId,
|
||||
@RequestParam("orderId") Long orderId);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否满足拼团活动条件
|
||||
|
@ -61,7 +62,19 @@ public interface CombinationRecordApi {
|
|||
* @param count 数量
|
||||
* @return 拼团信息
|
||||
*/
|
||||
CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId,
|
||||
Long skuId, Integer count);
|
||||
@GetMapping("/validate-join")
|
||||
@Operation(summary = "【下单前】校验是否满足拼团活动条件") // 如果校验失败,则抛出业务异常
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024"),
|
||||
@Parameter(name = "activityId", description = "活动编号", required = true, example = "2048"),
|
||||
@Parameter(name = "headId", description = "团长编号", required = true, example = "4096"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "8192"),
|
||||
@Parameter(name = "count", description = "数量", required = true, example = "1"),
|
||||
})
|
||||
CombinationValidateJoinRespDTO validateJoinCombination(@RequestParam("userId") Long userId,
|
||||
@RequestParam("activityId") Long activityId,
|
||||
@RequestParam("headId") Long headId,
|
||||
@RequestParam("skuId") Long skuId,
|
||||
@RequestParam("count") Integer count);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,36 +3,34 @@ package cn.iocoder.yudao.module.promotion.api.coupon;
|
|||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponUseReqDTO;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponValidReqDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 优惠劵 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 优惠劵")
|
||||
public interface CouponApi {
|
||||
|
||||
/**
|
||||
* 使用优惠劵
|
||||
*
|
||||
* @param useReqDTO 使用请求
|
||||
*/
|
||||
void useCoupon(@Valid CouponUseReqDTO useReqDTO);
|
||||
String PREFIX = ApiConstants.PREFIX + "/coupon";
|
||||
|
||||
/**
|
||||
* 退还已使用的优惠券
|
||||
*
|
||||
* @param id 优惠券编号
|
||||
*/
|
||||
void returnUsedCoupon(Long id);
|
||||
@PutMapping(PREFIX + "/use")
|
||||
@Operation(summary = "使用优惠劵")
|
||||
void useCoupon(@RequestBody @Valid CouponUseReqDTO useReqDTO);
|
||||
|
||||
/**
|
||||
* 校验优惠劵
|
||||
*
|
||||
* @param validReqDTO 校验请求
|
||||
* @return 优惠劵
|
||||
*/
|
||||
@PutMapping(PREFIX + "/return-used")
|
||||
@Parameter(name = "id", description = "优惠券编号", required = true, example = "1")
|
||||
void returnUsedCoupon(@RequestParam("id") Long id);
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "校验优惠劵")
|
||||
CouponRespDTO validateCoupon(@Valid CouponValidReqDTO validReqDTO);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.coupon;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵模版 API 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface CouponTemplateApi {
|
||||
|
||||
/**
|
||||
* 获得优惠券模版的精简信息列表
|
||||
*
|
||||
* @param ids 优惠券模版编号
|
||||
* @return 优惠券模版的精简信息列表
|
||||
*/
|
||||
List<CouponTemplateRespDTO> getCouponTemplateListByIds(Collection<Long> ids);
|
||||
|
||||
}
|
|
@ -1,23 +1,26 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.discount;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.api.discount.dto.DiscountProductRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 限时折扣 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 限时折扣")
|
||||
public interface DiscountActivityApi {
|
||||
|
||||
/**
|
||||
* 获得商品匹配的的限时折扣信息
|
||||
*
|
||||
* @param skuIds 商品 SKU 编号数组
|
||||
* @return 限时折扣信息
|
||||
*/
|
||||
List<DiscountProductRespDTO> getMatchDiscountProductList(Collection<Long> skuIds);
|
||||
String PREFIX = ApiConstants.PREFIX + "/discount-activity";
|
||||
|
||||
@GetMapping(PREFIX + "/list-by-sku-id")
|
||||
@Operation(summary = "获得商品匹配的的限时折扣信息")
|
||||
@Parameter(name = "skuIds", description = "商品 SKU 编号数组", required = true, example = "[1, 2]")
|
||||
List<DiscountProductRespDTO> getMatchDiscountProductList(@RequestParam("skuIds") Collection<Long> skuIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,26 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.reward;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.api.reward.dto.RewardActivityMatchRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 满减送活动 API 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 满减送")
|
||||
public interface RewardActivityApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/reward-activity";
|
||||
|
||||
/**
|
||||
* 基于指定的 SPU 编号数组,获得它们匹配的满减送活动
|
||||
*
|
||||
* @param spuIds SPU 编号数组
|
||||
* @return 满减送活动列表
|
||||
*/
|
||||
List<RewardActivityMatchRespDTO> getMatchRewardActivityList(Collection<Long> spuIds);
|
||||
@GetMapping(PREFIX + "/list-by-spu-id")
|
||||
@Operation(summary = "获得商品匹配的的满减送活动信息")
|
||||
@Parameter(name = "spuIds", description = "商品 SPU 编号数组", required = true, example = "[1, 2]")
|
||||
List<RewardActivityMatchRespDTO> getMatchRewardActivityList(@RequestParam("spuIds") Collection<Long> spuIds);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,42 +1,53 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.seckill;
|
||||
|
||||
import cn.iocoder.yudao.module.promotion.api.seckill.dto.SeckillValidateJoinRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 秒杀活动 API 接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 秒杀活动")
|
||||
public interface SeckillActivityApi {
|
||||
|
||||
/**
|
||||
* 更新秒杀库存(减少)
|
||||
*
|
||||
* @param id 活动编号
|
||||
* @param skuId sku 编号
|
||||
* @param count 数量(正数)
|
||||
*/
|
||||
void updateSeckillStockDecr(Long id, Long skuId, Integer count);
|
||||
String PREFIX = ApiConstants.PREFIX + "/discount-activity";
|
||||
|
||||
/**
|
||||
* 更新秒杀库存(增加)
|
||||
*
|
||||
* @param id 活动编号
|
||||
* @param skuId sku 编号
|
||||
* @param count 数量(正数)
|
||||
*/
|
||||
void updateSeckillStockIncr(Long id, Long skuId, Integer count);
|
||||
@PutMapping(PREFIX + "/update-stock-decr")
|
||||
@Operation(summary = "更新秒杀库存(减少)")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "活动编号", required = true, example = "1"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"),
|
||||
@Parameter(name = "count", description = "数量", required = true, example = "3"),
|
||||
})
|
||||
void updateSeckillStockDecr(@RequestParam("id") Long id,
|
||||
@RequestParam("skuId") Long skuId,
|
||||
@RequestParam("count")Integer count);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否参与秒杀活动
|
||||
*
|
||||
* 如果校验失败,则抛出业务异常
|
||||
*
|
||||
* @param activityId 活动编号
|
||||
* @param skuId SKU 编号
|
||||
* @param count 数量
|
||||
* @return 秒杀信息
|
||||
*/
|
||||
SeckillValidateJoinRespDTO validateJoinSeckill(Long activityId, Long skuId, Integer count);
|
||||
@PutMapping(PREFIX + "/update-stock-incr")
|
||||
@Operation(summary = "更新秒杀库存(增加)")
|
||||
@Parameters({
|
||||
@Parameter(name = "id", description = "活动编号", required = true, example = "1"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"),
|
||||
@Parameter(name = "count", description = "数量", required = true, example = "3"),
|
||||
})
|
||||
void updateSeckillStockIncr(@RequestParam("id") Long id,
|
||||
@RequestParam("skuId") Long skuId,
|
||||
@RequestParam("count")Integer count);
|
||||
|
||||
@GetMapping("/validate-join")
|
||||
@Operation(summary = "【下单前】校验是否参与秒杀活动") // 如果校验失败,则抛出业务异常
|
||||
@Parameters({
|
||||
@Parameter(name = "activityId", description = "活动编号", required = true, example = "1"),
|
||||
@Parameter(name = "skuId", description = "SKU 编号", required = true, example = "2"),
|
||||
@Parameter(name = "count", description = "数量", required = true, example = "3"),
|
||||
})
|
||||
SeckillValidateJoinRespDTO validateJoinSeckill(@RequestParam("activityId") Long activityId,
|
||||
@RequestParam("skuId") Long skuId,
|
||||
@RequestParam("count")Integer count);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.combination;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 拼团活动 Api 接口实现类
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Service
|
||||
public class CombinationActivityApiImpl implements CombinationActivityApi {
|
||||
|
||||
}
|
|
@ -44,11 +44,6 @@ public class CombinationRecordApiImpl implements CombinationRecordApi {
|
|||
return CombinationRecordStatusEnum.isSuccess(record.getStatus());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRecordStatusToFailed(Long userId, Long orderId) {
|
||||
recordService.updateCombinationRecordStatusByUserIdAndOrderId(CombinationRecordStatusEnum.FAILED.getStatus(), userId, orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId, Long skuId, Integer count) {
|
||||
return recordService.validateJoinCombination(userId, activityId, headId, skuId, count);
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
package cn.iocoder.yudao.module.promotion.api.coupon;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.dto.CouponTemplateRespDTO;
|
||||
import cn.iocoder.yudao.module.promotion.convert.coupon.CouponTemplateConvert;
|
||||
import cn.iocoder.yudao.module.promotion.service.coupon.CouponTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 优惠劵模版 API 接口实现类
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
@Service
|
||||
public class CouponTemplateApiImpl implements CouponTemplateApi {
|
||||
|
||||
@Resource
|
||||
private CouponTemplateService couponTemplateService;
|
||||
|
||||
@Override
|
||||
public List<CouponTemplateRespDTO> getCouponTemplateListByIds(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) { // 防御一下
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return CouponTemplateConvert.INSTANCE.convertList(couponTemplateService.getCouponTemplateListByIds(ids));
|
||||
}
|
||||
|
||||
}
|
|
@ -75,8 +75,4 @@ public interface CouponTemplateMapper extends BaseMapperX<CouponTemplateDO> {
|
|||
return canTakeConsumer;
|
||||
}
|
||||
|
||||
default List<CouponTemplateDO> selectListByIds(Collection<Long> ids) {
|
||||
return selectList(new LambdaQueryWrapperX<CouponTemplateDO>().in(CouponTemplateDO::getId, ids));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,15 +21,6 @@ import java.util.Map;
|
|||
*/
|
||||
public interface CombinationRecordService {
|
||||
|
||||
/**
|
||||
* 更新拼团状态
|
||||
*
|
||||
* @param status 状态
|
||||
* @param userId 用户编号
|
||||
* @param orderId 订单编号
|
||||
*/
|
||||
void updateCombinationRecordStatusByUserIdAndOrderId(Integer status, Long userId, Long orderId);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否满足拼团活动条件
|
||||
*
|
||||
|
@ -62,15 +53,6 @@ public interface CombinationRecordService {
|
|||
*/
|
||||
CombinationRecordDO getCombinationRecord(Long userId, Long orderId);
|
||||
|
||||
/**
|
||||
* 获取拼团记录
|
||||
*
|
||||
* @param userId 用户 id
|
||||
* @param activityId 活动 id
|
||||
* @return 拼团记录列表
|
||||
*/
|
||||
List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId);
|
||||
|
||||
/**
|
||||
* 【下单前】校验是否满足拼团活动条件
|
||||
*
|
||||
|
|
|
@ -66,16 +66,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
|||
@Resource
|
||||
private TradeOrderApi tradeOrderApi;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateCombinationRecordStatusByUserIdAndOrderId(Integer status, Long userId, Long orderId) {
|
||||
// 校验拼团是否存在
|
||||
CombinationRecordDO record = validateCombinationRecord(userId, orderId);
|
||||
|
||||
// 更新状态
|
||||
combinationRecordMapper.updateById(new CombinationRecordDO().setId(record.getId()).setStatus(status));
|
||||
}
|
||||
|
||||
private CombinationRecordDO validateCombinationRecord(Long userId, Long orderId) {
|
||||
// 校验拼团是否存在
|
||||
CombinationRecordDO recordDO = combinationRecordMapper.selectByUserIdAndOrderId(userId, orderId);
|
||||
|
@ -229,11 +219,6 @@ public class CombinationRecordServiceImpl implements CombinationRecordService {
|
|||
return combinationRecordMapper.selectByUserIdAndOrderId(userId, orderId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CombinationRecordDO> getCombinationRecordListByUserIdAndActivityId(Long userId, Long activityId) {
|
||||
return combinationRecordMapper.selectListByUserIdAndActivityId(userId, activityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CombinationValidateJoinRespDTO validateJoinCombination(Long userId, Long activityId, Long headId,
|
||||
Long skuId, Integer count) {
|
||||
|
|
|
@ -8,7 +8,6 @@ import cn.iocoder.yudao.module.promotion.dal.dataobject.coupon.CouponTemplateDO;
|
|||
import cn.iocoder.yudao.module.promotion.enums.coupon.CouponTakeTypeEnum;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -92,12 +91,4 @@ public interface CouponTemplateService {
|
|||
List<CouponTemplateDO> getCouponTemplateList(List<Integer> canTakeTypes, Integer productScope,
|
||||
Long productScopeValue, Integer count);
|
||||
|
||||
/**
|
||||
* 获得优惠券模版列表
|
||||
*
|
||||
* @param ids 优惠券模版编号
|
||||
* @return 优惠券模版列表
|
||||
*/
|
||||
List<CouponTemplateDO> getCouponTemplateListByIds(Collection<Long> ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -127,9 +127,4 @@ public class CouponTemplateServiceImpl implements CouponTemplateService {
|
|||
return couponTemplateMapper.selectList(canTakeTypes, productScope, productScopeValue, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CouponTemplateDO> getCouponTemplateListByIds(Collection<Long> ids) {
|
||||
return couponTemplateMapper.selectListByIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,18 +18,20 @@ import java.util.List;
|
|||
@Tag(name = "RPC 服务 - 订单")
|
||||
public interface TradeOrderApi {
|
||||
|
||||
@GetMapping("/list")
|
||||
String PREFIX = ApiConstants.PREFIX + "/order";
|
||||
|
||||
@GetMapping(PREFIX + "/list")
|
||||
@Operation(summary = "获得订单列表")
|
||||
@Parameter(name = "ids", description = "订单编号数组", required = true)
|
||||
List<TradeOrderRespDTO> getOrderList(@RequestParam("ids") Collection<Long> ids);
|
||||
|
||||
@GetMapping("/get")
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得订单")
|
||||
@Parameter(name = "id", description = "订单编号", required = true)
|
||||
TradeOrderRespDTO getOrder(@RequestParam("id") Long id);
|
||||
|
||||
// TODO 芋艿:需要优化下;
|
||||
@PutMapping("/cancel-paid")
|
||||
@PutMapping(PREFIX + "/cancel-paid")
|
||||
@Parameters({
|
||||
@Parameter(name = "userId", description = "用户编号", required = true, example = "1024"),
|
||||
@Parameter(name = "orderId", description = "订单编号", required = true, example = "2048"),
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package cn.iocoder.yudao.module.trade.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.member.api.address.MemberAddressApi;
|
||||
import cn.iocoder.yudao.module.member.api.config.MemberConfigApi;
|
||||
import cn.iocoder.yudao.module.member.api.level.MemberLevelApi;
|
||||
import cn.iocoder.yudao.module.member.api.point.MemberPointApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.pay.api.order.PayOrderApi;
|
||||
import cn.iocoder.yudao.module.pay.api.refund.PayRefundApi;
|
||||
import cn.iocoder.yudao.module.product.api.category.ProductCategoryApi;
|
||||
import cn.iocoder.yudao.module.product.api.comment.ProductCommentApi;
|
||||
import cn.iocoder.yudao.module.product.api.sku.ProductSkuApi;
|
||||
import cn.iocoder.yudao.module.product.api.spu.ProductSpuApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.bargain.BargainActivityApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.bargain.BargainRecordApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.combination.CombinationRecordApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.coupon.CouponApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.discount.DiscountActivityApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.reward.RewardActivityApi;
|
||||
import cn.iocoder.yudao.module.promotion.api.seckill.SeckillActivityApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {
|
||||
BargainActivityApi.class, BargainRecordApi.class, CombinationRecordApi.class,
|
||||
CouponApi.class, DiscountActivityApi.class, RewardActivityApi.class, SeckillActivityApi.class,
|
||||
MemberUserApi.class, MemberPointApi.class, MemberLevelApi.class, MemberAddressApi.class, MemberConfigApi.class,
|
||||
ProductSpuApi.class, ProductSkuApi.class, ProductCommentApi.class, ProductCategoryApi.class,
|
||||
PayOrderApi.class, PayRefundApi.class,
|
||||
NotifyMessageSendApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* 占位
|
||||
*/
|
||||
package cn.iocoder.yudao.module.trade.framework.rpc;
|
|
@ -0,0 +1,37 @@
|
|||
package cn.iocoder.yudao.module.trade.framework.security.config;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
|
||||
import cn.iocoder.yudao.module.member.enums.ApiConstants;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
|
||||
|
||||
/**
|
||||
* Trade 模块的 Security 配置
|
||||
*/
|
||||
@Configuration("tradeSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean("tradeAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
||||
return new AuthorizeRequestsCustomizer() {
|
||||
|
||||
@Override
|
||||
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
|
||||
// Swagger 接口文档
|
||||
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
|
||||
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
|
||||
// Spring Boot Actuator 的安全配置
|
||||
registry.antMatchers("/actuator").anonymous()
|
||||
.antMatchers("/actuator/**").anonymous();
|
||||
// Druid 监控
|
||||
registry.antMatchers("/druid/**").anonymous();
|
||||
// RPC 服务的安全配置
|
||||
registry.antMatchers(ApiConstants.PREFIX + "/**").permitAll();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
/**
|
||||
* 占位
|
||||
*/
|
||||
package cn.iocoder.yudao.module.trade.framework.security.core;
|
|
@ -111,3 +111,4 @@ yudao:
|
|||
admin-ui:
|
||||
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
|
||||
demo: true # 开启演示模式
|
||||
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
|
||||
|
|
|
@ -139,3 +139,4 @@ yudao:
|
|||
error-code: # 错误码相关配置项
|
||||
enable: false
|
||||
demo: false # 关闭演示模式
|
||||
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
|
||||
|
|
|
@ -130,5 +130,19 @@ yudao:
|
|||
enable: true
|
||||
ignore-urls:
|
||||
ignore-tables:
|
||||
trade:
|
||||
order:
|
||||
app-id: 1 # 商户编号
|
||||
pay-expire-time: 2h # 支付的过期时间
|
||||
receive-expire-time: 14d # 收货的过期时间
|
||||
comment-expire-time: 7d # 评论的过期时间
|
||||
express:
|
||||
client: kd_niao
|
||||
kd-niao:
|
||||
api-key: cb022f1e-48f1-4c4a-a723-9001ac9676b8
|
||||
business-id: 1809751
|
||||
kd100:
|
||||
key: pLXUGAwK5305
|
||||
customer: E77DF18BE109F454A5CD319E44BF5177
|
||||
|
||||
debug: false
|
||||
|
|
Loading…
Reference in New Issue