diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java index 488c2203..ae7d85e9 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/toolkit/MessageConvert.java @@ -3,7 +3,6 @@ package cn.hippo4j.common.toolkit; import cn.hippo4j.common.monitor.AbstractMessage; import cn.hippo4j.common.monitor.Message; import cn.hippo4j.common.monitor.MessageWrapper; -import cn.hutool.core.bean.BeanUtil; import lombok.SneakyThrows; import java.util.ArrayList; @@ -31,7 +30,11 @@ public class MessageConvert { List> messageMapList = new ArrayList(); List messages = message.getMessages(); - messages.forEach(each -> messageMapList.add(BeanUtil.beanToMap(each))); + messages.forEach(each -> { + String eachVal = JSONUtil.toJSONString(each); + Map mapObj = JSONUtil.parseObject(eachVal, Map.class); + messageMapList.add(mapObj); + }); wrapper.setContentParams(messageMapList); return wrapper; @@ -49,7 +52,11 @@ public class MessageConvert { List> contentParams = messageWrapper.getContentParams(); List messages = new ArrayList(); - contentParams.forEach(each -> messages.add(BeanUtil.toBean(each, messageWrapper.getResponseClass()))); + contentParams.forEach(each -> { + String eachVal = JSONUtil.toJSONString(each); + Message messageObj = JSONUtil.parseObject(eachVal, messageWrapper.getResponseClass()); + messages.add(messageObj); + }); message.setMessages(messages); message.setMessageType(messageWrapper.getMessageType());