feat: support requestID auto append in agent websocket

This commit is contained in:
CaiHQ 2021-11-01 18:52:02 +08:00
parent 85cc377563
commit b2d359ba05
2 changed files with 10 additions and 18 deletions

View File

@ -6,10 +6,18 @@ import java.util.HashMap;
import java.util.Map;
public class ReplyUtil {
public static void simpleReply(ResultCallback cb, String action, Object data) {
public static void simpleReply(ResultCallback resultCallback, String action, Object data) {
Map<String, Object> ret = new HashMap<>();
ret.put("action", action);
ret.put("data", data);
cb.onResult(ret);
resultCallback.onResult(ret);
}
public static void replyWithStatus(ResultCallback resultCallback, String action, boolean status,Object data) {
Map<String, Object> ret = new HashMap<>();
ret.put("action", action);
ret.put("status",status);
ret.put("data", data);
resultCallback.onResult(ret);
}
}

View File

@ -1,16 +0,0 @@
package org.bdware.server.action;
public class Result {
boolean status;
String msg;
String action = null;
Object data;
String responseID;
Result() {
status = false;
msg = null;
data = "";
responseID="";
}
}