Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
shalousun committed May 30, 2021
2 parents 0a9f622 + e4c1863 commit 761edaf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/power/doc/builder/TornaBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package com.power.doc.builder;

import com.google.gson.Gson;
import com.power.common.util.CollectionUtil;
import com.power.common.util.OkHttp3Util;
import com.power.common.util.StringUtil;
import com.power.doc.constants.TornaConstants;
Expand Down Expand Up @@ -108,14 +109,18 @@ public static void buildTorna(List<ApiDoc> apiDocs, ApiConfig apiConfig, JavaPro
//推送字典信息
Map<String, Object> dicMap = new HashMap<>(2);
List<TornaDic> docDicts = TornaUtil.buildTornaDic(DocUtil.buildDictionary(apiConfig, builder));
dicMap.put("enums", docDicts);
Map<String, String> dicRequestJson = TornaConstants.buildParams(ENUM_PUSH, new Gson().toJson(dicMap), apiConfig);
if(CollectionUtil.isNotEmpty(docDicts)) {
dicMap.put("enums", docDicts);
Map<String, String> dicRequestJson = TornaConstants.buildParams(ENUM_PUSH, new Gson().toJson(dicMap), apiConfig);
String dicResponseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(dicRequestJson));
TornaUtil.printDebugInfo(apiConfig, dicResponseMsg, dicRequestJson, ENUM_PUSH);
}
//获取返回结果
String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson));
String dicResponseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(dicRequestJson));

//开启调试时打印请求信息
TornaUtil.printDebugInfo(apiConfig, responseMsg, requestJson, PUSH);
TornaUtil.printDebugInfo(apiConfig, dicResponseMsg, dicRequestJson, ENUM_PUSH);

}
}

11 changes: 8 additions & 3 deletions src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package com.power.doc.builder.rpc;

import com.google.gson.Gson;
import com.power.common.util.CollectionUtil;
import com.power.common.util.OkHttp3Util;
import com.power.common.util.StringUtil;
import com.power.doc.builder.ProjectDocConfigBuilder;
Expand Down Expand Up @@ -111,13 +112,17 @@ public static void buildTorna(List<RpcApiDoc> apiDocs, ApiConfig apiConfig,JavaP
//推送字典信息
Map<String,Object> dicMap = new HashMap<>(2);
List<TornaDic> docDicts =TornaUtil.buildTornaDic(DocUtil.buildDictionary(apiConfig,builder));
dicMap.put("enums",docDicts);

if(CollectionUtil.isNotEmpty(docDicts)) {
dicMap.put("enums", docDicts);
Map<String, String> dicRequestJson = TornaConstants.buildParams(ENUM_PUSH, new Gson().toJson(dicMap), apiConfig);
String dicResponseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(dicRequestJson));
TornaUtil.printDebugInfo(apiConfig, dicResponseMsg, dicRequestJson, ENUM_PUSH);
}
Map<String, String> dicRequestJson = TornaConstants.buildParams(ENUM_PUSH, new Gson().toJson(dicMap), apiConfig);
//获取返回结果
String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson));
String dicResponseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(dicRequestJson));
//开启调试时打印请求信息
TornaUtil.printDebugInfo(apiConfig, responseMsg, requestJson,PUSH);
TornaUtil.printDebugInfo(apiConfig, dicResponseMsg, dicRequestJson,ENUM_PUSH);
}
}

0 comments on commit 761edaf

Please sign in to comment.