Commit f65be0ae by Future

添加日志打印

parent 755ec6ea
package com.wecloud.dispatch.general; package com.wecloud.dispatch.general;
import com.alibaba.fastjson.JSON;
import io.geekidea.springbootplus.framework.common.api.ApiCode; import io.geekidea.springbootplus.framework.common.api.ApiCode;
import io.geekidea.springbootplus.framework.common.exception.BusinessException; import io.geekidea.springbootplus.framework.common.exception.BusinessException;
import io.geekidea.springbootplus.framework.common.exception.DaoException; import io.geekidea.springbootplus.framework.common.exception.DaoException;
...@@ -105,4 +106,22 @@ public class GeneralMessageHandler { ...@@ -105,4 +106,22 @@ public class GeneralMessageHandler {
channelSender.sendMsgLocal((NioSocketChannel) am.getSenderChannel(), res); channelSender.sendMsgLocal((NioSocketChannel) am.getSenderChannel(), res);
} }
} }
public static void main(String[] args) {
String str = "{\"conversationId\":1518190080274190336,\"attributes\":\"{\\\"count\\\":1}\"}";
// 解析jsonO
BaseRequest baseRequest = JsonUtils.decodeJson(str, BaseRequest.class);
System.out.println(JSON.toJSONString(baseRequest));
}
} }
...@@ -44,7 +44,7 @@ public class JsonUtils { ...@@ -44,7 +44,7 @@ public class JsonUtils {
try { try {
return OBJECT_MAPPER.readValue(strJsonBody, c); return OBJECT_MAPPER.readValue(strJsonBody, c);
} catch (IOException e) { } catch (IOException e) {
log.warn("解析json字符串失败,原字符串: {}", strJsonBody); log.warn("解析json字符串失败,原字符串: {}", strJsonBody, e);
return null; return null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment