mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
update 打印日志
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jsowell.service;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
@@ -207,7 +208,7 @@ public class AgentDevService {
|
||||
|
||||
String result = HttpUtils.sendPost(url, jsonObject.toString());
|
||||
JSONObject jsonResult = JSONObject.parseObject(result);
|
||||
logger.info("获取第三方平台 token 请求结果:{}", JSONObject.toJSONString(jsonResult));
|
||||
logger.info("获取第三方平台 token 请求结果:{}", JSON.toJSONString(jsonResult));
|
||||
// 获取返回值中的 token
|
||||
token = jsonResult.getString("component_access_token");
|
||||
if (token == null) {
|
||||
@@ -240,8 +241,8 @@ public class AgentDevService {
|
||||
jsonObject.put("component_appid", PLATFORM_APP_ID);
|
||||
jsonObject.put("authorization_code", authorizationCode);
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 使用授权码获取授权信息 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 使用授权码获取授权信息 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将结果转换成json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
if (Objects.isNull(resultJson)) {
|
||||
@@ -249,7 +250,7 @@ public class AgentDevService {
|
||||
}
|
||||
// AuthInfoVO authInfoVO = (AuthInfoVO) resultJson.get("authorization_info");
|
||||
|
||||
AuthInfoVO authInfoVO = JSONObject.parseObject(JSONObject.toJSONString(resultJson.get("authorization_info")), AuthInfoVO.class);
|
||||
AuthInfoVO authInfoVO = JSONObject.parseObject(JSON.toJSONString(resultJson.get("authorization_info")), AuthInfoVO.class);
|
||||
if (authInfoVO == null) {
|
||||
throw new RuntimeException("获取第三方平台 使用授权码获取授权信息 error");
|
||||
}
|
||||
@@ -305,8 +306,8 @@ public class AgentDevService {
|
||||
jsonObject.put("authorizer_appid", authAppId);
|
||||
jsonObject.put("authorizer_refresh_token", refreshToken);
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 通过刷新令牌获取接口令牌 请求参数:{}\n, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 通过刷新令牌获取接口令牌 请求参数:{}\n, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转成 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -341,12 +342,12 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/commit?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("template_id", dto.getTemplateId());
|
||||
jsonObject.put("ext_json", JSONObject.toJSONString(dto.getExtJson()));
|
||||
jsonObject.put("ext_json", JSON.toJSONString(dto.getExtJson()));
|
||||
jsonObject.put("user_version", dto.getUserVersion());
|
||||
jsonObject.put("user_desc", dto.getUserDesc());
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 提交代码 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("获取第三方平台 提交代码 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -407,13 +408,13 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/submit_audit?access_token=" + authAccessToken;
|
||||
|
||||
// List --> JsonArray
|
||||
JSONArray itemArray = JSONArray.parseArray(JSONObject.toJSONString(itemList));
|
||||
JSONArray itemArray = JSONArray.parseArray(JSON.toJSONString(itemList));
|
||||
// 发送请求
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("item_list", itemArray);
|
||||
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 提交代码审核 请求参数:{}, 请求结果:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 提交代码审核 请求参数:{}, 请求结果:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
int errCode = (int) resultJson.get("errcode");
|
||||
@@ -450,7 +451,7 @@ public class AgentDevService {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("auditid", dto.getAuditId());
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
int errCode = (int) resultJson.get("errcode");
|
||||
@@ -494,8 +495,8 @@ public class AgentDevService {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("component_appid", PLATFORM_APP_ID);
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 获取预授权码请求 params:{}, result:{}", JSONObject.toJSONString(jsonObject), result);
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
logger.info("微信第三方平台 获取预授权码请求 params:{}, result:{}", JSON.toJSONString(jsonObject), result);
|
||||
// 将返回结果转成json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
preAuthCode = resultJson.getString("pre_auth_code");
|
||||
@@ -548,7 +549,7 @@ public class AgentDevService {
|
||||
// }
|
||||
String url = "https://api.weixin.qq.com/wxa/release?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回结果转为json对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
// int errCode = (int) resultJson.get("errcode");
|
||||
@@ -603,7 +604,7 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/cgi-bin/component/setprivacysetting?access_token=" + authAccessToken;
|
||||
List<UserInfoSetting> settingList = dto.getSettingList();
|
||||
// 转为 jsonArray
|
||||
JSONArray itemArray = JSONArray.parseArray(JSONObject.toJSONString(settingList));
|
||||
JSONArray itemArray = JSONArray.parseArray(JSON.toJSONString(settingList));
|
||||
// 拼接参数
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("privacy_ver", dto.getPrivacyVer());
|
||||
@@ -611,7 +612,7 @@ public class AgentDevService {
|
||||
jsonObject.put("owner_setting", dto.getOwnerSetting());
|
||||
|
||||
// 发送请求
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 转为 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
|
||||
@@ -647,7 +648,7 @@ public class AgentDevService {
|
||||
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + authAccessToken;
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", code);
|
||||
String result = HttpUtils.sendPost(url, JSONObject.toJSONString(jsonObject));
|
||||
String result = HttpUtils.sendPost(url, JSON.toJSONString(jsonObject));
|
||||
// 将返回值转成 json 对象
|
||||
JSONObject resultJson = JSONObject.parseObject(result);
|
||||
Integer errCode = resultJson.getInteger("errcode");
|
||||
|
||||
Reference in New Issue
Block a user