|
|
@@ -55,7 +55,7 @@ public class FamilyPlatformBalanceController {
|
|
|
|
|
|
/** 用家庭CF值兑换优惠券 */
|
|
|
@PostMapping("/exchange-coupon")
|
|
|
- public Result<String> exchangeCoupon(
|
|
|
+ public Result<Long> exchangeCoupon(
|
|
|
@RequestAttribute("userId") Long userId,
|
|
|
@RequestBody Map<String, Object> params) {
|
|
|
if (userId == null) return Result.error("未登录");
|
|
|
@@ -66,9 +66,8 @@ public class FamilyPlatformBalanceController {
|
|
|
Long couponId = ParamUtils.getLong(params.get("couponId"));
|
|
|
if (couponId == null) return Result.error("couponId不能为空");
|
|
|
try {
|
|
|
- familyPlatformPointsService.exchangeCouponByCf(user.getFamilyId(), couponId, userId);
|
|
|
- // TODO: 实际发券逻辑待实现
|
|
|
- return Result.success("兑换成功");
|
|
|
+ Long familyCouponId = familyPlatformPointsService.exchangeCouponByCf(user.getFamilyId(), couponId, userId);
|
|
|
+ return Result.success("兑换成功", familyCouponId);
|
|
|
} catch (RuntimeException e) {
|
|
|
return Result.error(e.getMessage());
|
|
|
}
|