...
|
...
|
@@ -43,7 +43,7 @@ public class CouponProxyService implements Compensator { |
|
|
public List<UserCouponsBo> getUserAvailableCoupons(int uid) {
|
|
|
logger.info("[{}] getUserAvailableCoupons", uid);
|
|
|
//未使用的优惠券,包括还未生效的券
|
|
|
ApiResponse resp = serviceCaller.call("app.coupons.listNoUsed", uid);
|
|
|
ApiResponse resp = serviceCaller.call("ufo.coupons.listNoUsed", uid);
|
|
|
UserCouponsListBo result = getResultFromApiResponse(resp);
|
|
|
if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
|
|
|
return Lists.newArrayList();
|
...
|
...
|
@@ -56,7 +56,7 @@ public class CouponProxyService implements Compensator { |
|
|
public List<UserCouponsBo> checkAndGetCoupons(int uid, List<String> couponCodes) {
|
|
|
logger.info("[{}] checkAndGetCoupons:{}", uid, couponCodes);
|
|
|
//未使用的优惠券,包括还未生效的券
|
|
|
ApiResponse resp = serviceCaller.call("app.coupons.checkAndGet", uid, couponCodes);
|
|
|
ApiResponse resp = serviceCaller.call("ufo.coupons.checkAndGet", uid, couponCodes);
|
|
|
UserCouponsListBo result = getResultFromApiResponse(resp);
|
|
|
if (Objects.isNull(result) || CollectionUtils.isEmpty(result.getCoupons())) {
|
|
|
return Lists.newArrayList();
|
...
|
...
|
@@ -76,7 +76,7 @@ public class CouponProxyService implements Compensator { |
|
|
public void orderUseCoupon(@TxCompensateArgs("uid") int uid, @TxCompensateArgs("orderCode") long orderCode,
|
|
|
@TxCompensateArgs("couponBo") CouponBo coupon) {
|
|
|
logger.info("[{}] request to use coupon,couponBo is {}", orderCode, coupon);
|
|
|
ApiResponse resp = serviceCaller.call("app.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
|
|
|
ApiResponse resp = serviceCaller.call("ufo.coupons.use", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
|
|
|
Boolean result = getResultFromApiResponse(resp);
|
|
|
if (result == null || result.booleanValue() == false) {
|
|
|
logger.warn("[{}] use couponBo fail,coupons is {}", orderCode, coupon);
|
...
|
...
|
@@ -95,7 +95,7 @@ public class CouponProxyService implements Compensator { |
|
|
*/
|
|
|
public void orderCancelCoupon(int uid, long orderCode, CouponBo coupon) {
|
|
|
logger.info("[{}] request to cancel coupon,couponBo is {}", orderCode, coupon);
|
|
|
ApiResponse resp = serviceCaller.call("app.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
|
|
|
ApiResponse resp = serviceCaller.call("ufo.coupons.cancel", uid, orderCode, Lists.newArrayList(coupon.getCouponCode()));
|
|
|
Boolean result = getResultFromApiResponse(resp);
|
|
|
if (result == null || result.booleanValue() == false) {
|
|
|
logger.warn("[{}] cancel coupon fail,couponBo is {}", orderCode, coupon);
|
...
|
...
|
|