mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
格式化开放平台模块代码
This commit is contained in:
@@ -2,6 +2,7 @@ package me.chanjar.weixin.open.util;
|
||||
|
||||
import me.chanjar.weixin.open.api.WxOpenConfigStorage;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
/**
|
||||
* @author <a href="https://github.com/007gzs">007</a>
|
||||
*/
|
||||
|
||||
@@ -22,18 +22,18 @@ public class WxOpenAuthorizationInfoGsonAdapter implements JsonDeserializer<WxOp
|
||||
authorizationInfo.setAuthorizerRefreshToken(GsonHelper.getString(jsonObject, "authorizer_refresh_token"));
|
||||
List<Integer> funcInfo = new ArrayList<>();
|
||||
JsonArray jsonArray = GsonHelper.getAsJsonArray(jsonObject.get("func_info"));
|
||||
if(jsonArray != null && !jsonArray.isJsonNull()){
|
||||
for(int i = 0; i < jsonArray.size(); i++){
|
||||
if (jsonArray != null && !jsonArray.isJsonNull()) {
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
jsonObject = jsonArray.get(i).getAsJsonObject();
|
||||
if(jsonObject == null || jsonObject.isJsonNull()){
|
||||
if (jsonObject == null || jsonObject.isJsonNull()) {
|
||||
continue;
|
||||
}
|
||||
jsonObject = jsonObject.getAsJsonObject("funcscope_category");
|
||||
if(jsonObject == null || jsonObject.isJsonNull()){
|
||||
if (jsonObject == null || jsonObject.isJsonNull()) {
|
||||
continue;
|
||||
}
|
||||
Integer id = GsonHelper.getInteger(jsonObject, "id");
|
||||
if(id == null) {
|
||||
if (id == null) {
|
||||
continue;
|
||||
}
|
||||
funcInfo.add(id);
|
||||
|
||||
@@ -23,10 +23,10 @@ public class WxOpenAuthorizerInfoGsonAdapter implements JsonDeserializer<WxOpenA
|
||||
authorizationInfo.setPrincipalName(GsonHelper.getString(jsonObject, "principal_name"));
|
||||
authorizationInfo.setAlias(GsonHelper.getString(jsonObject, "alias"));
|
||||
authorizationInfo.setQrcodeUrl(GsonHelper.getString(jsonObject, "qrcode_url"));
|
||||
if(jsonObject.has("service_type_info")) {
|
||||
if (jsonObject.has("service_type_info")) {
|
||||
authorizationInfo.setServiceTypeInfo(GsonHelper.getInteger(jsonObject.getAsJsonObject("service_type_info"), "id"));
|
||||
}
|
||||
if(jsonObject.has("verify_type_info")) {
|
||||
if (jsonObject.has("verify_type_info")) {
|
||||
authorizationInfo.setVerifyTypeInfo(GsonHelper.getInteger(jsonObject.getAsJsonObject("verify_type_info"), "id"));
|
||||
}
|
||||
Map<String, Integer> businessInfo = WxOpenGsonBuilder.create().fromJson(jsonObject.get("business_info"),
|
||||
|
||||
Reference in New Issue
Block a user