From 2340f7bc8ba84f90fa3d1a9f1e48febe8aa04404 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 30 Dec 2021 22:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E5=88=87=E6=8D=A2=20BeanUtil?= =?UTF-8?q?=20=E8=BD=AC=E6=8D=A2.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/hippo4j/common/toolkit/MessageConvert.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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());