feat: 全局格式化代码

This commit is contained in:
evo
2025-12-06 14:38:41 +08:00
parent 96c53390aa
commit 7c7d5838cd
538 changed files with 21132 additions and 14160 deletions

View File

@@ -13,7 +13,7 @@ public class PayConfig {
/**
* 商户ID
*/
private String pid;
private String pid;
/**
* 接口地址
@@ -23,7 +23,7 @@ public class PayConfig {
/**
* 私钥
*/
private String key ;
private String key;
/**
* 服务器异步通知地址

View File

@@ -40,7 +40,7 @@ public class PayInit {
payConfig.setReturn_url(getKey("return_url"));
}
public String getKey(String key){
public String getKey(String key) {
return configService.getConfigValue("pay", key);
}

View File

@@ -11,12 +11,12 @@ public interface PayService {
/**
* 获取支付地址
*
* @Date 2023/7/3
* @param orderNo
* @param name
* @param money
* @param clientIp
* @return String
* @Date 2023/7/3
**/
String getPayUrl(String orderNo, String name, double money, String clientIp);

View File

@@ -14,6 +14,7 @@ import java.util.Map;
/**
* 支付服务
*
* @author Admin
*/
@Service
@@ -28,8 +29,8 @@ public class PayServiceImpl implements PayService {
String out_trade_no = orderNo, sign = "";
//封装请求参数
String mdString = "clientip=" + clientIp + "&device=" + payConfig.getDevice() + "&money=" + money + "&name=" + name + "&" +
"notify_url=" + payConfig.getNotify_url() + "&out_trade_no=" + out_trade_no + "&pid=" + payConfig.getPid() + "&return_url=" + payConfig.getReturn_url() +
"&type=" + payConfig.getType() + payConfig.getKey();
"notify_url=" + payConfig.getNotify_url() + "&out_trade_no=" + out_trade_no + "&pid=" + payConfig.getPid() + "&return_url=" + payConfig.getReturn_url() +
"&type=" + payConfig.getType() + payConfig.getKey();
sign = MD5Util.GetMD5Code(mdString);
Map<String, Object> map = new HashMap<>(10);
map.put("clientip", clientIp);
@@ -44,7 +45,7 @@ public class PayServiceImpl implements PayService {
map.put("type", payConfig.getType());
map.put("sign", sign);
String body = HttpUtil.post(payConfig.getPayUrl(), map);
log.info("支付返回信息:{},配置信息: {}",body,payConfig);
log.info("支付返回信息:{},配置信息: {}", body, payConfig);
JSONObject jsonObject = new JSONObject(body);
return (String) jsonObject.get("qrcode");
}

View File

@@ -17,8 +17,8 @@ public class MD5Util {
/**
* 全局数组
*/
public final static String[] strDigits = { "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
public final static String[] strDigits = {"0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
public MD5Util() {
}
@@ -26,9 +26,9 @@ public class MD5Util {
/**
* 返回形式为数字跟字符串
*
* @Date 2023/7/3
* @param bByte
* @return String
* @Date 2023/7/3
**/
public static String byteToArrayString(byte bByte) {
int iRet = bByte;
@@ -43,9 +43,9 @@ public class MD5Util {
/**
* 转换字节数组为16进制字串
*
* @Date 2023/7/3
* @param bByte
* @return String
* @Date 2023/7/3
**/
public static String byteToString(byte[] bByte) {
StringBuffer sBuffer = new StringBuffer();
@@ -58,9 +58,9 @@ public class MD5Util {
/**
* 生成md5代码
*
* @Date 2023/7/3
* @param strObj
* @return String
* @Date 2023/7/3
**/
public static String GetMD5Code(String strObj) {
String resultString = null;