prune: delete ResultBack

This commit is contained in:
CaiHQ 2021-11-01 17:31:35 +08:00
parent bb33d5b0e7
commit 66b18fd63a
2 changed files with 6 additions and 32 deletions

View File

@ -15,7 +15,6 @@ import org.bdware.sc.util.JsonUtil;
import org.bdware.server.GRPCPool; import org.bdware.server.GRPCPool;
import org.bdware.server.GlobalConf; import org.bdware.server.GlobalConf;
import org.bdware.server.action.p2p.MasterClientTCPAction; import org.bdware.server.action.p2p.MasterClientTCPAction;
import org.bdware.server.nodecenter.ResultBack;
import org.bdware.server.trustedmodel.MasterProxy; import org.bdware.server.trustedmodel.MasterProxy;
import org.bdware.server.ws.ContractManagerFrameHandler; import org.bdware.server.ws.ContractManagerFrameHandler;
import org.bdware.units.NetworkManager; import org.bdware.units.NetworkManager;
@ -649,13 +648,8 @@ public class CMActions implements OnHashCallback {
String contractName = json.get("contractName").getAsString(); String contractName = json.get("contractName").getAsString();
String functionName = json.get("functionName").getAsString(); String functionName = json.get("functionName").getAsString();
String args = json.get("args").getAsString(); String args = json.get("args").getAsString();
String test = manager.getGasEvaluates(contractName, functionName, args); String test = manager.getGasEvaluates(contractName, functionName, args);
ReplyUtil.simpleReply(resultCallback,"onEvaluates","success");
ResultBack result = new ResultBack();
result.action = "onEvaluates";
result.data = "success";
resultCallback.onResult(JsonUtil.toJson(result));
} }
@Action(userPermission = 1L << 16) @Action(userPermission = 1L << 16)
@ -1599,10 +1593,7 @@ public class CMActions implements OnHashCallback {
closePermission = closePermission.replace(", ", ""); closePermission = closePermission.replace(", ", "");
String resetPermission = manager.resetPermission(contractFileName, closePermission, isOpen); String resetPermission = manager.resetPermission(contractFileName, closePermission, isOpen);
LOGGER.debug(resetPermission); LOGGER.debug(resetPermission);
ResultBack result = new ResultBack(); ReplyUtil.simpleReply(resultCallback,"onSetPermission","success");
result.action = "onSetPermission";
result.data = "success";
resultCallback.onResult(JsonUtil.toJson(result));
} }
@Action(userPermission = 1L << 26, async = true, httpAccess = false) @Action(userPermission = 1L << 26, async = true, httpAccess = false)
@ -1610,10 +1601,7 @@ public class CMActions implements OnHashCallback {
boolean flag = json.get("isDebug").getAsBoolean(); boolean flag = json.get("isDebug").getAsBoolean();
String contractID = json.get("contractID").getAsString(); String contractID = json.get("contractID").getAsString();
String resetPermission = manager.resetDebugFlag(contractID, flag); String resetPermission = manager.resetDebugFlag(contractID, flag);
ResultBack result = new ResultBack(); ReplyUtil.simpleReply(resultCallback,"onSetDebugFlag",resetPermission);
result.action = "onSetDebugFlag";
result.data = resetPermission;
resultCallback.onResult(JsonUtil.toJson(result));
} }
@Override @Override

View File

@ -10,7 +10,6 @@ import org.bdware.sc.db.CMTables;
import org.bdware.sc.db.KeyValueDBUtil; import org.bdware.sc.db.KeyValueDBUtil;
import org.bdware.sc.util.JsonUtil; import org.bdware.sc.util.JsonUtil;
import org.bdware.server.GlobalConf; import org.bdware.server.GlobalConf;
import org.bdware.server.nodecenter.ResultBack;
import org.bdware.server.permission.Role; import org.bdware.server.permission.Role;
import org.bdware.server.ws.ContractManagerFrameHandler; import org.bdware.server.ws.ContractManagerFrameHandler;
import org.zz.gmhelper.SM2Util; import org.zz.gmhelper.SM2Util;
@ -162,14 +161,9 @@ public class UserManagerAction {
List<Jedion.KV> time = KeyValueDBUtil.instance.getKeyValues(CMTables.ApplyTime.toString()); List<Jedion.KV> time = KeyValueDBUtil.instance.getKeyValues(CMTables.ApplyTime.toString());
List<Jedion.KV> kv = KeyValueDBUtil.instance.getKeyValues(CMTables.ApplyRole.toString()); List<Jedion.KV> kv = KeyValueDBUtil.instance.getKeyValues(CMTables.ApplyRole.toString());
Map<String, Object> ret = new HashMap<>(); Map<String, Object> ret = new HashMap<>();
ret.put("kv", kv); ret.put("kv", kv);
ret.put("time", time); ret.put("time", time);
ResultBack result = new ResultBack(); ReplyUtil.simpleReply(resultCallback,"onListUnAuthRole",ret);
result.action = "onListUnAuthRole";
result.data = ret;
resultCallback.onResult(JsonUtil.toJson(result));
// resultCallback.onResult("{\"action\":\"onListUnAuthRole\",\"data\":\"success\"}");
} }
@Action(userPermission = 1 << 11) @Action(userPermission = 1 << 11)
@ -177,13 +171,9 @@ public class UserManagerAction {
List<Jedion.KV> kv = KeyValueDBUtil.instance.getKeyValues(CMTables.NodeRole.toString()); List<Jedion.KV> kv = KeyValueDBUtil.instance.getKeyValues(CMTables.NodeRole.toString());
List<Jedion.KV> time = KeyValueDBUtil.instance.getKeyValues(CMTables.NodeTime.toString()); List<Jedion.KV> time = KeyValueDBUtil.instance.getKeyValues(CMTables.NodeTime.toString());
Map<String, Object> ret = new HashMap<>(); Map<String, Object> ret = new HashMap<>();
ret.put("kv", kv); ret.put("kv", kv);
ret.put("time", time); ret.put("time", time);
ResultBack result = new ResultBack(); ReplyUtil.simpleReply(resultCallback,"onListAllAuthRole",ret);
result.action = "onListAllAuthRole";
result.data = ret;
resultCallback.onResult(JsonUtil.toJson(result));
} }
@Action(userPermission = 1L << 11) @Action(userPermission = 1L << 11)
@ -220,11 +210,7 @@ public class UserManagerAction {
map.put("ContractProvider", cp); map.put("ContractProvider", cp);
map.put("ContractInstanceManager", cm); map.put("ContractInstanceManager", cm);
map.put("ContractUser", cp); map.put("ContractUser", cp);
ResultBack result = new ResultBack(); ReplyUtil.simpleReply(resultCallback,"onCountRole",map);
result.action = "onCountRole";
result.data = map;
result.status = true;
resultCallback.onResult(JsonUtil.toJson(result));
} }
@Action(userPermission = 1 << 10) @Action(userPermission = 1 << 10)