ITBOX-ITBOY commented on code in PR #10184:
URL: https://github.com/apache/dolphinscheduler/pull/10184#discussion_r880200204
##########
dolphinscheduler-task-plugin/dolphinscheduler-task-http/src/main/java/org/apache/dolphinscheduler/plugin/task/http/HttpParameters.java:
##########
@@ -130,4 +136,44 @@ public int getSocketTimeout() {
public void setSocketTimeout(int socketTimeout) {
this.socketTimeout = socketTimeout;
}
+ @Override
+ public void dealOutParam(String result) {
+ if (CollectionUtils.isEmpty(localParams)) {
+ return;
+ }
+ List<Property> outProperty = getOutProperty(localParams);
+ if (CollectionUtils.isEmpty(outProperty)) {
+ return;
+ }
+ if (StringUtils.isEmpty(result)) {
+ varPool.addAll(outProperty);
+ return;
+ }
+ Map<String, String> httpMapByString = getHttpMapByString(result);
+ //判断是否为空
+ if (httpMapByString == null || httpMapByString.size() == 0) {
+ return;
+ }
+
+ for (Property info : outProperty) {
+ info.setValue(httpMapByString.get(info.getProp()));
+ varPool.add(info);
+ }
+ }
+
+ protected String setBodyReturn(String updateResult, List<Property>
properties) {
+ String result = null;
+ List<Map<String, String>> updateRL = new ArrayList<>();
+ Map<String, String> updateRM = new HashMap<>();
+ for (Property info : properties) {
+ if (Direct.OUT == info.getDirect()) {
+ updateRM.put(info.getProp(), updateResult);
+ updateRL.add(updateRM);
+ result = JSONUtils.toJsonString(updateRL);
+ // break;
Review Comment:
This part of code cannot be deleted because updateResult gets the body
value, info.getProp() gets the output key from localParm,
{"body":{"userName":"testName"}}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]