|
|
@@ -6,10 +6,10 @@ import cn.hutool.crypto.SecureUtil;
|
|
|
import cn.hutool.http.HttpRequest;
|
|
|
import cn.hutool.http.HttpResponse;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springblade.common.utils.SpringContextHolder;
|
|
|
+import org.springblade.core.log.logger.BladeLogger;
|
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springblade.core.tool.utils.DigestUtil;
|
|
|
@@ -31,8 +31,12 @@ import java.util.*;
|
|
|
* @Date: Created in 11:43 2021/11/11
|
|
|
* @Modified By:
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
public class CmccUtil {
|
|
|
+ /**
|
|
|
+ * 日志
|
|
|
+ */
|
|
|
+ private static final BladeLogger logger = SpringContextHolder.getBean(BladeLogger.class);
|
|
|
+
|
|
|
/**
|
|
|
* cmcc配置
|
|
|
*/
|
|
|
@@ -89,12 +93,12 @@ public class CmccUtil {
|
|
|
//添加SignKey
|
|
|
param.add(cmccPointConfig.getSignKey());
|
|
|
String paramValue = ArrayUtil.join(param.toArray(), "");
|
|
|
- log.warn("CMCC-排序后参数:{}", paramValue);
|
|
|
+ logger.warn("CMCC-排序后参数:{}", paramValue);
|
|
|
//进行签名
|
|
|
cmccRequest.setSign(SecureUtil.md5(paramValue));
|
|
|
// cmccRequest.setCheckType("01");
|
|
|
// cmccRequest.setSign(SecureUtil.md5(cmccRequest.getRequestId()+cmccPointConfig.getSignKey()));
|
|
|
- log.warn("CMCC-签名后参数:{}", JSONObject.toJSONString(cmccRequest));
|
|
|
+ logger.warn("CMCC-签名后参数:{}", JSONObject.toJSONString(cmccRequest));
|
|
|
return cmccRequest;
|
|
|
}
|
|
|
|
|
|
@@ -198,7 +202,8 @@ public class CmccUtil {
|
|
|
HttpResponse httpResponse = HttpRequest.post(new StringBuilder(cmccPointConfig.getUrl()).append(url).toString())
|
|
|
//添加参数,进行签名
|
|
|
.body(JSONObject.toJSONString(cmccRequest)).execute();
|
|
|
- log.info("CMCC-请求响应内容:{}", httpResponse.body());
|
|
|
+
|
|
|
+ logger.info("CMCC-请求响应内容:{}", httpResponse.body());
|
|
|
JSONObject jsonObject = JSONObject.parseObject(httpResponse.body());
|
|
|
CmccResponse cmccResponse;
|
|
|
if (ObjectUtils.isNotEmpty(jsonObject.get("respCode"))) {
|