refactor(coupon): 重构优惠券领取结果封装

- 在 CouponClaimResult 类中添加 PriceCouponConfig 类型的 coupon 字段
- 修改 success 静态方法,接收 PriceCouponConfig 对象作为参数
- 更新方法内部逻辑,使用 coupon 对象替代单独的 couponName 字段
- 调整 CouponServiceImpl 中的代码,适应新的 CouponClaimResult 结构
This commit is contained in:
2025-09-17 15:29:16 +08:00
parent 6006fe460c
commit 5626498002
2 changed files with 7 additions and 4 deletions

View File

@@ -274,7 +274,7 @@ public class CouponServiceImpl implements ICouponService {
request.getUserId(), request.getCouponId(), claimRecord.getId());
// 10. 返回成功结果
return CouponClaimResult.success(claimRecord, coupon.getCouponName());
return CouponClaimResult.success(claimRecord, coupon);
} catch (Exception e) {
log.error("领取优惠券失败: userId={}, couponId={}",