|
@@ -19,24 +19,24 @@ public class ShareVolutionServiceImpl implements ShareVolutionService {
|
|
|
@Value("${remote.local-live.base-url}")
|
|
@Value("${remote.local-live.base-url}")
|
|
|
private String localLiveBaseUrl;
|
|
private String localLiveBaseUrl;
|
|
|
|
|
|
|
|
- private static final String GET_VOLUTION_DETAIL_PATH = "/customer/volution/getVolutionDetailByShareVolutionId";
|
|
|
|
|
|
|
+ private static final String GET_VOLUTION_DETAIL_PATH = "/customer/volution/getVolutionDetailByCouponId";
|
|
|
|
|
|
|
|
private static final int DEFAULT_TIMEOUT = 5000;
|
|
private static final int DEFAULT_TIMEOUT = 5000;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public R<ShareVolutionDetailVO> getVolutionDetailByShareVolutionId(String shareVolutionId) {
|
|
|
|
|
- if (StrUtil.isBlank(shareVolutionId)) {
|
|
|
|
|
- return R.fail("分享优惠券ID不能为空");
|
|
|
|
|
|
|
+ public R<ShareVolutionDetailVO> getVolutionDetailByCouponId(String couponId) {
|
|
|
|
|
+ if (StrUtil.isBlank(couponId)) {
|
|
|
|
|
+ return R.fail("优惠券ID不能为空");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
- String url = localLiveBaseUrl + GET_VOLUTION_DETAIL_PATH + "?shareVolutionId=" + shareVolutionId;
|
|
|
|
|
- log.info("调用远程接口查询分享优惠券详情, URL: {}, shareVolutionId: {}", url, shareVolutionId);
|
|
|
|
|
|
|
+ String url = localLiveBaseUrl + GET_VOLUTION_DETAIL_PATH + "?couponId=" + couponId;
|
|
|
|
|
+ log.info("调用远程接口查询优惠券详情, URL: {}, couponId: {}", url, couponId);
|
|
|
|
|
|
|
|
String result = HttpUtil.get(url, DEFAULT_TIMEOUT);
|
|
String result = HttpUtil.get(url, DEFAULT_TIMEOUT);
|
|
|
if (StrUtil.isEmpty(result)) {
|
|
if (StrUtil.isEmpty(result)) {
|
|
|
- log.error("调用远程接口返回为空, shareVolutionId: {}", shareVolutionId);
|
|
|
|
|
- return R.fail("查询分享优惠券详情失败");
|
|
|
|
|
|
|
+ log.error("调用远程接口返回为空, couponId: {}", couponId);
|
|
|
|
|
+ return R.fail("查询优惠券详情失败");
|
|
|
}
|
|
}
|
|
|
log.info("调用远程接口返回结果: {}", result);
|
|
log.info("调用远程接口返回结果: {}", result);
|
|
|
|
|
|
|
@@ -56,8 +56,8 @@ public class ShareVolutionServiceImpl implements ShareVolutionService {
|
|
|
ShareVolutionDetailVO detailVO = JSON.parseObject(resultData.toJSONString(), ShareVolutionDetailVO.class);
|
|
ShareVolutionDetailVO detailVO = JSON.parseObject(resultData.toJSONString(), ShareVolutionDetailVO.class);
|
|
|
return R.ok(detailVO);
|
|
return R.ok(detailVO);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- log.error("调用远程接口异常, shareVolutionId: {}", shareVolutionId, e);
|
|
|
|
|
- throw new ServiceException("查询分享优惠券详情异常: " + e.getMessage());
|
|
|
|
|
|
|
+ log.error("调用远程接口异常, couponId: {}", couponId, e);
|
|
|
|
|
+ throw new ServiceException("查询优惠券详情异常: " + e.getMessage());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|