mirror of
https://gitee.com/BDWare/custom-plugin
synced 2025-01-09 17:34:18 +00:00
front: support startMulitipoint with args
fix: ContractClient missing arguments error update: @Router arguments format fix: ContractStatusRecorder null exception
This commit is contained in:
parent
b468f5947f
commit
bfd389f30e
@ -128,29 +128,16 @@ public class MultiPointCooperationExecutor extends AbstractContextContractExecut
|
||||
return new String[]{members[val]};
|
||||
case byFunc:
|
||||
ContractClient client = cmActions.getManager().getClient(req.getContractID());
|
||||
|
||||
JsonArray membersArr = new JsonArray(members.length);
|
||||
for (String member : members) {
|
||||
membersArr.add(member);
|
||||
}
|
||||
|
||||
JsonObject arg = new JsonObject();
|
||||
arg.addProperty("funcName", routeInfo.funcName);
|
||||
// func myFunc (currentNode, members, membersCount, sourceArg)
|
||||
// func myFunc (requester, sourceArg)
|
||||
JsonArray funcArgs = new JsonArray();
|
||||
funcArgs.add(globalConf.getNodeID());
|
||||
funcArgs.add(membersArr);
|
||||
funcArgs.add(membersArr.size());
|
||||
funcArgs.add(req.getRequester());
|
||||
funcArgs.add(req.getArg());
|
||||
arg.add("funcArgs", funcArgs);
|
||||
|
||||
String routeResultStr = client.executeMethod("", "invokeFunctionWithoutLimit", arg.toString());
|
||||
JsonObject routeResult = JsonUtil.parseString(routeResultStr).getAsJsonObject();
|
||||
List<String> nodes = new ArrayList<>();
|
||||
for (String key: routeResult.keySet()) {
|
||||
nodes.add(routeResult.get(key).getAsString());
|
||||
}
|
||||
return nodes.toArray(new String[]{});
|
||||
String[] routeResult = JsonUtil.fromJson(routeResultStr, String[].class);
|
||||
return routeResult;
|
||||
default:
|
||||
return members;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user