mirror of
https://gitee.com/BDWare/front-base
synced 2025-01-25 01:04:01 +00:00
feat: support requestID auto append in agent websocket
This commit is contained in:
parent
85cc377563
commit
b2d359ba05
@ -6,10 +6,18 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class ReplyUtil {
|
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<>();
|
Map<String, Object> ret = new HashMap<>();
|
||||||
ret.put("action", action);
|
ret.put("action", action);
|
||||||
ret.put("data", data);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -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="";
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user