This commit is contained in:
attiya 2025-10-30 17:08:36 +08:00
parent 8da950c803
commit e5f6e16d8c

View File

@ -13,7 +13,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
public class CommandUtil { public class CommandUtil {
private static final ObjectMapper mapper = new ObjectMapper(); private static final ObjectMapper mapper = new ObjectMapper();
private static final String prefix = "ecu/rsp/cdzybms/"; private static final String prefix = "ecu/cmd/cdzybms/";
public static String guang_he_tong(String ecuSn, String taskId, String code) throws JsonProcessingException { public static String guang_he_tong(String ecuSn, String taskId, String code) throws JsonProcessingException {
@ -23,7 +23,7 @@ public class CommandUtil {
switch (code) { switch (code) {
case CommandType.FIND_BIKE: case CommandType.FIND_BIKE:
String json = "{\"c\":14,\"tid\":\"e8957e7dde5a487895b22286d5046ffc\",\"param\":{\"volume\":50,\"idx\":5}}"; String json = "{\"c\":14,\"tid\":\""+ taskId+"\",\"param\":{\"volume\":50,\"idx\":5}}";
ObjectNode objectNode = mapper.readValue(json,ObjectNode.class); ObjectNode objectNode = mapper.readValue(json,ObjectNode.class);
objectNode.put("tid",taskId); objectNode.put("tid",taskId);
jsonNode.put("command",objectNode.toString()); jsonNode.put("command",objectNode.toString());