mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-23 10:31:52 +08:00
切换日志组件
This commit is contained in:
@@ -8,8 +8,8 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.http.util.Args;
|
||||
|
||||
/**
|
||||
@@ -22,7 +22,7 @@ import org.apache.http.util.Args;
|
||||
* </pre>
|
||||
*/
|
||||
public final class DateUtils {
|
||||
private static final Log LOG = LogFactory.getLog(DateUtils.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DateUtils.class);
|
||||
|
||||
private DateUtils() {
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public final class DateUtils {
|
||||
return formatFor.parse(date);
|
||||
}
|
||||
catch (ParseException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.egzosn.pay.common.util;
|
||||
|
||||
import com.egzosn.pay.common.api.PayErrorExceptionHandler;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ import org.apache.commons.logging.LogFactory;
|
||||
*/
|
||||
public class LogExceptionHandler implements PayErrorExceptionHandler {
|
||||
|
||||
protected final Log log = LogFactory.getLog(PayErrorExceptionHandler.class);
|
||||
protected final Logger LOGGER = LoggerFactory.getLogger(PayErrorExceptionHandler.class);
|
||||
|
||||
@Override
|
||||
public void handle(PayErrorException e) {
|
||||
|
||||
log.error("Error happens", e);
|
||||
LOGGER.error("Error happens", e);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
package com.egzosn.pay.common.util.sign;
|
||||
|
||||
import com.egzosn.pay.common.util.str.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -35,7 +35,7 @@ import java.util.Enumeration;
|
||||
* 声明:以下代码只是为了方便接入方测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考,不提供编码,性能,规范性等方面的保障
|
||||
*/
|
||||
public class CertDescriptor {
|
||||
protected static final Log LOG = LogFactory.getLog(CertDescriptor.class);
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(CertDescriptor.class);
|
||||
/**
|
||||
* 证书容器,存储对商户请求报文签名私钥证书.
|
||||
*/
|
||||
|
||||
@@ -6,8 +6,8 @@ import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PublicKey;
|
||||
import java.security.Signature;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.egzosn.pay.common.bean.result.PayException;
|
||||
import com.egzosn.pay.common.exception.PayErrorException;
|
||||
@@ -15,7 +15,7 @@ import com.egzosn.pay.common.util.sign.encrypt.sm3.SM3Digest;
|
||||
|
||||
public class SecureUtil {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(SecureUtil.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SecureUtil.class);
|
||||
/**
|
||||
* 算法常量: SHA1
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ public class SecureUtil {
|
||||
return md.digest();
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class SecureUtil {
|
||||
return sha1StrBuff.toString().getBytes(encoding);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class SecureUtil {
|
||||
bytes = SecureUtil.sm3(data.getBytes(encoding));
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
StringBuilder sm3StrBuff = new StringBuilder();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.util.UUID;
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
|
||||
import com.egzosn.pay.common.bean.SignType;
|
||||
@@ -93,13 +93,13 @@ public enum SignUtils implements SignType {
|
||||
return sb.toString().toUpperCase();
|
||||
}
|
||||
catch (NoSuchAlgorithmException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (InvalidKeyException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
throw new PayErrorException(new PayException("fail", "HMACSHA256 签名异常"));
|
||||
@@ -177,7 +177,7 @@ public enum SignUtils implements SignType {
|
||||
return com.egzosn.pay.common.util.sign.encrypt.RSA2.verify(text, sign, publicKey, characterEncoding);
|
||||
}
|
||||
};
|
||||
private static final Log LOG = LogFactory.getLog(SignUtils.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(SignUtils.class);
|
||||
|
||||
/**
|
||||
* 把数组所有元素排序,并按照“参数=参数值”的模式用“@param separator”字符拼接成字符串
|
||||
|
||||
@@ -17,8 +17,8 @@ import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* RSA
|
||||
@@ -29,7 +29,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* </pre>
|
||||
*/
|
||||
public class RSA {
|
||||
private static final Log LOG = LogFactory.getLog(RSA.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(RSA.class);
|
||||
private static final String ALGORITHM = "RSA";
|
||||
|
||||
|
||||
@@ -61,10 +61,10 @@ public class RSA {
|
||||
return Base64.encode(signed);
|
||||
}
|
||||
catch (GeneralSecurityException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -89,10 +89,10 @@ public class RSA {
|
||||
return Base64.encode(signed);
|
||||
}
|
||||
catch (GeneralSecurityException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -142,10 +142,10 @@ public class RSA {
|
||||
return signature.verify(Base64.decode(sign));
|
||||
}
|
||||
catch (GeneralSecurityException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -168,10 +168,10 @@ public class RSA {
|
||||
return signature.verify(Base64.decode(sign));
|
||||
}
|
||||
catch (GeneralSecurityException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
LOG.error("", e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user