style 一些代码样式的修改

This commit is contained in:
DaxPay
2024-10-10 13:51:26 +08:00
parent 3f8dc60a6f
commit 0a4337c455
6 changed files with 25 additions and 24 deletions

View File

@@ -96,6 +96,24 @@ public class AliPayConfigService {
channelConfigManager.updateById(channelConfig);
}
/**
* 获取异步通知地址
*/
public String getNotifyUrl() {
var mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
var platformInfo = platformConfigService.getConfig();
return StrUtil.format("{}/unipay/callback/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
}
/**
* 获取同步通知地址
*/
public String getReturnUrl() {
MchAppLocal mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
var platformInfo = platformConfigService.getConfig();
return StrUtil.format("{}/unipay/return/{}/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
}
/**
* 获取支付宝支付配置
*/
@@ -124,24 +142,6 @@ public class AliPayConfigService {
return this.getAlipayClient(aliPayConfig);
}
/**
* 获取异步通知地址
*/
public String getNotifyUrl() {
var mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
var platformInfo = platformConfigService.getConfig();
return StrUtil.format("{}/unipay/callback/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
}
/**
* 获取同步通知地址
*/
public String getReturnUrl() {
MchAppLocal mchAppInfo = PaymentContextLocal.get().getMchAppInfo();
var platformInfo = platformConfigService.getConfig();
return StrUtil.format("{}/unipay/return/{}/{}/alipay",platformInfo.getGatewayServiceUrl(), mchAppInfo.getAppId());
}
/**
* 获取支付宝SDK的配置
*/

View File

@@ -43,7 +43,7 @@ public class AliPayAuthService {
return new AuthUrlResult();
} else {
PlatformConfig platformConfig = platformsConfigService.getConfig();
AliPayConfig aliPayConfig = aliPayConfigService.getAliPayConfig();
AliPayConfig aliPayConfig = aliPayConfigService.getAndCheckConfig();
String queryCode = RandomUtil.randomString(10);
// 授权地址

View File

@@ -47,8 +47,7 @@ public class AliPayService {
* 支付前检查支付方式是否可用
*/
public void validation(PayParam payParam) {
AliPayConfig alipayConfig = aliPayConfigService.getAliPayConfig();
AliPayConfig alipayConfig = aliPayConfigService.getAndCheckConfig();
// 验证订单金额是否超限
if(BigDecimalUtil.isGreaterThan(payParam.getAmount(), alipayConfig.getLimitAmount())){
throw new AmountExceedLimitException("支付宝支付金额超过限额");

View File

@@ -103,7 +103,7 @@ public class AliPayTransferService {
}
/**
*
* 转换收款人类型
*/
public String getIdentityType(TransferPayeeTypeEnum payeeType){
switch (payeeType){

View File

@@ -35,7 +35,7 @@ public class AliPayCloseStrategy extends AbsPayCloseStrategy {
*/
@Override
public void doBeforeCloseHandler() {
this.alipayConfig = alipayConfigService.getAliPayConfig();
this.alipayConfig = alipayConfigService.getAndCheckConfig();
}
/**

View File

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import lombok.Setter;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.*;
import org.apache.http.client.HttpResponseException;
@@ -308,6 +309,7 @@ public class ClientHttpRequest<T> extends HttpEntityEnclosingRequestBase impleme
* @return 对应的响应对象
* @throws IOException 响应类型文本转换时抛出异常
*/
@SneakyThrows
private T toBean(HttpEntity entity, String[] contentType) throws IOException {
@@ -330,7 +332,7 @@ public class ClientHttpRequest<T> extends HttpEntityEnclosingRequestBase impleme
if (responseType == OutputStream.class){
t= new ByteArrayOutputStream();
}else {
t = (OutputStream) responseType.newInstance();
t = (OutputStream) responseType.getDeclaredConstructor().newInstance();
}
entity.writeTo( t);
return (T) t;