feat:【IoT 物联网】增加消息总线(messagebus)的 rocketmq 实现

This commit is contained in:
YunaiV
2025-05-28 09:57:50 +08:00
parent 39fb31d400
commit 70a0df54e4
11 changed files with 516 additions and 131 deletions

View File

@@ -99,6 +99,18 @@ public class JsonUtils {
}
}
public static <T> T parseObject(byte[] text, Type type) {
if (ArrayUtil.isEmpty(text)) {
return null;
}
try {
return objectMapper.readValue(text, objectMapper.getTypeFactory().constructType(type));
} catch (IOException e) {
log.error("json parse err,json:{}", text, e);
throw new RuntimeException(e);
}
}
/**
* 将字符串解析成指定类型的对象
* 使用 {@link #parseObject(String, Class)} 时,在@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS) 的场景下,