Commit f0acbe1b authored by shiyu's avatar shiyu

消息发送时间格式化

parent 8ea3cd68
...@@ -80,7 +80,7 @@ public class IMCallbackController { ...@@ -80,7 +80,7 @@ public class IMCallbackController {
imRecord.setFromAccount(imUtil.revertAppletUserId(fromAccount)); imRecord.setFromAccount(imUtil.revertAppletUserId(fromAccount));
imRecord.setToAccount(imUtil.revertAppletUserId(toAccount)); imRecord.setToAccount(imUtil.revertAppletUserId(toAccount));
imRecord.setMsgTime(new Date( msgTime)); imRecord.setMsgTime(new Date(msgTime * 1000L));
imRecord.setMsgKey(msgKey); imRecord.setMsgKey(msgKey);
imRecord.setMsgType(IMEnum.MsgTypeEnum.getCodeByValue(msgType)); imRecord.setMsgType(IMEnum.MsgTypeEnum.getCodeByValue(msgType));
imRecord.setSendMsgResult(Integer.valueOf(sendMsgResult)); imRecord.setSendMsgResult(Integer.valueOf(sendMsgResult));
...@@ -104,6 +104,10 @@ public class IMCallbackController { ...@@ -104,6 +104,10 @@ public class IMCallbackController {
"\"MsgContent\":{\"Text\":\"秦始皇并没有发行货币,而是统一了货币。他颁布了统一的货币,即圆形方孔钱,也称为“秦钱”。这种货币由铜制成,大小不一,但一般都呈圆形,中间有一个孔,方便钱货交流。\"}}]," + "\"MsgContent\":{\"Text\":\"秦始皇并没有发行货币,而是统一了货币。他颁布了统一的货币,即圆形方孔钱,也称为“秦钱”。这种货币由铜制成,大小不一,但一般都呈圆形,中间有一个孔,方便钱货交流。\"}}]," +
"\"UnreadMsgNum\":151,\"MsgVersion\":0,\"MsgRandom\":730361011,\"EventTime\":1698131421787,\"MsgSeq\":164841877,\"MsgKey\":\"164841877_730361011_1698131421\"," + "\"UnreadMsgNum\":151,\"MsgVersion\":0,\"MsgRandom\":730361011,\"EventTime\":1698131421787,\"MsgSeq\":164841877,\"MsgKey\":\"164841877_730361011_1698131421\"," +
"\"From_Account\":\"cjxc-applet-dev_ai10002\",\"MsgTime\":1698131421}"; "\"From_Account\":\"cjxc-applet-dev_ai10002\",\"MsgTime\":1698131421}";
long MsgTime = Long.valueOf(JsonUtils.getValueByPath(jsonStr, "MsgTime"));
System.out.println(new Date(MsgTime));
System.out.println(new Date(MsgTime * 1000L));
//消息体 //消息体
String msgBody = JsonUtils.getValueByPath(jsonStr, "MsgBody"); String msgBody = JsonUtils.getValueByPath(jsonStr, "MsgBody");
System.out.println("msgBody = " + msgBody); System.out.println("msgBody = " + msgBody);
......
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