mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
加注释
This commit is contained in:
@@ -48,7 +48,7 @@ public class PayController extends BaseController {
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 充值余额支付
|
||||
* 充值余额支付/微信余额充值
|
||||
* 提供给小程序使用
|
||||
* http://localhost:8080/uniapp/pay/weixinPay
|
||||
*/
|
||||
@@ -92,40 +92,6 @@ public class PayController extends BaseController {
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 汇付充值余额
|
||||
* 会员充值余额 汇付
|
||||
* http://localhost:8080/uniapp/pay/rechargeBalance
|
||||
*/
|
||||
@PostMapping("/rechargeBalance")
|
||||
public RestApiResponse<?> rechargeBalance(HttpServletRequest request, @RequestBody WeixinPayDTO dto) {
|
||||
logger.info("adapay会员充值余额 param:{}", dto.toString());
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getCode()) || StringUtils.isBlank(dto.getAmount())) {
|
||||
return new RestApiResponse<>(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
// 鉴权
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (StringUtils.isBlank(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
||||
}
|
||||
dto.setMemberId(memberId);
|
||||
String openId = memberService.getOpenIdByCode(dto.getCode());
|
||||
if (StringUtils.isBlank(openId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
||||
}
|
||||
dto.setOpenId(openId);
|
||||
// 充值余额 附加参数
|
||||
Map<String, Object> weixinMap = memberService.rechargeBalanceWithAdapay(dto);
|
||||
response = new RestApiResponse<>(ImmutableMap.of("weixinMap", weixinMap));
|
||||
} catch (Exception e) {
|
||||
response = new RestApiResponse<>();
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 7002 支付订单
|
||||
* http://localhost:8080/uniapp/pay/payOrder
|
||||
@@ -242,7 +208,7 @@ public class PayController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信退款接口
|
||||
* 微信退款接口/微信余额退款
|
||||
* https://api.jsowellcloud.com/uniapp/pay/refund
|
||||
*/
|
||||
@PostMapping("/refund")
|
||||
@@ -271,8 +237,39 @@ public class PayController extends BaseController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇付支付退款
|
||||
* 用户余额退款
|
||||
* 汇付充值余额/会员充值余额/汇付余额充值
|
||||
* http://localhost:8080/uniapp/pay/rechargeBalance
|
||||
*/
|
||||
@PostMapping("/rechargeBalance")
|
||||
public RestApiResponse<?> rechargeBalance(HttpServletRequest request, @RequestBody WeixinPayDTO dto) {
|
||||
logger.info("adapay会员充值余额 param:{}", dto.toString());
|
||||
RestApiResponse<?> response;
|
||||
try {
|
||||
if (StringUtils.isBlank(dto.getCode()) || StringUtils.isBlank(dto.getAmount())) {
|
||||
return new RestApiResponse<>(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
|
||||
}
|
||||
// 鉴权
|
||||
String memberId = getMemberIdByAuthorization(request);
|
||||
if (StringUtils.isBlank(memberId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_TOKEN_ERROR);
|
||||
}
|
||||
dto.setMemberId(memberId);
|
||||
String openId = memberService.getOpenIdByCode(dto.getCode());
|
||||
if (StringUtils.isBlank(openId)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
|
||||
}
|
||||
dto.setOpenId(openId);
|
||||
// 充值余额 附加参数
|
||||
Map<String, Object> weixinMap = memberService.rechargeBalanceWithAdapay(dto);
|
||||
response = new RestApiResponse<>(ImmutableMap.of("weixinMap", weixinMap));
|
||||
} catch (Exception e) {
|
||||
response = new RestApiResponse<>();
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇付支付退款/用户余额退款/汇付余额退款
|
||||
* https://api.jsowellcloud.com/uniapp/pay/refundBalance
|
||||
*/
|
||||
@PostMapping("/refundBalance")
|
||||
|
||||
Reference in New Issue
Block a user