|
|
@@ -1,4 +1,118 @@
|
|
|
-package com.kede.wechat.bo;
|
|
|
+package com.kede.wechat.bo;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import javafx.scene.text.Text;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
public class ChatMsg {
|
|
|
+// {\"msgid\":\"1634016854685227651_1749628622146_external\",\"action\":\"send\"," +
|
|
|
+// "\"from\":\"wopeIoCwAArS1POCA5Fiw6VidWWqkwVA\",\"tolist\":[\"KaKa\"],\"roomid\":\"\",\"msgtime\":1749628618742,\"msgtype\":\"text\",\"" +
|
|
|
+// "text\":{\"content\":\"您好,请详细描述您的问题,以便更快得到解答!\"}}";
|
|
|
+ private String msgid;
|
|
|
+ private String action;
|
|
|
+ private String from;
|
|
|
+ private List<String> tolist;
|
|
|
+ private String roomid;
|
|
|
+ private Long msgtime;
|
|
|
+ private String msgtype;
|
|
|
+ private String content;
|
|
|
+
|
|
|
+ public ChatMsg() {
|
|
|
+ }
|
|
|
+
|
|
|
+ public ChatMsg(JSONObject jsonObject) {
|
|
|
+ this.msgid = jsonObject.getString("msgid");
|
|
|
+ this.action = jsonObject.getString("action");
|
|
|
+ this.from = jsonObject.getString("from");
|
|
|
+ JSONArray tolist1 = jsonObject.getJSONArray("tolist");
|
|
|
+ this.tolist =tolist1.toJavaList(String.class);
|
|
|
+ this.roomid = jsonObject.getString("roomid");
|
|
|
+ this.msgtime = jsonObject.getLong("msgtime");
|
|
|
+ this.msgtype = jsonObject.getString("msgtype");
|
|
|
+ JSONObject text = jsonObject.getJSONObject("text");
|
|
|
+ this.content = text.getString("content");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public String getMsgid() {
|
|
|
+ return msgid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsgid(String msgid) {
|
|
|
+ this.msgid = msgid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getAction() {
|
|
|
+ return action;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setAction(String action) {
|
|
|
+ this.action = action;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getFrom() {
|
|
|
+ return from;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setFrom(String from) {
|
|
|
+ this.from = from;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<String> getTolist() {
|
|
|
+ return tolist;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setTolist(List<String> tolist) {
|
|
|
+ this.tolist = tolist;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getRoomid() {
|
|
|
+ return roomid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setRoomid(String roomid) {
|
|
|
+ this.roomid = roomid;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getMsgtime() {
|
|
|
+ return msgtime;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsgtime(Long msgtime) {
|
|
|
+ this.msgtime = msgtime;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getMsgtype() {
|
|
|
+ return msgtype;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setMsgtype(String msgtype) {
|
|
|
+ this.msgtype = msgtype;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getContent() {
|
|
|
+ return content;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setContent(String content) {
|
|
|
+ this.content = content;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ final StringBuffer sb = new StringBuffer("ChatMsg{");
|
|
|
+ sb.append("msgid='").append(msgid).append('\'');
|
|
|
+ sb.append(", action='").append(action).append('\'');
|
|
|
+ sb.append(", from='").append(from).append('\'');
|
|
|
+ sb.append(", tolist=").append(tolist);
|
|
|
+ sb.append(", roomid='").append(roomid).append('\'');
|
|
|
+ sb.append(", msgtime=").append(msgtime);
|
|
|
+ sb.append(", msgtype='").append(msgtype).append('\'');
|
|
|
+ sb.append(", content='").append(content).append('\'');
|
|
|
+ sb.append('}');
|
|
|
+ return sb.toString();
|
|
|
+ }
|
|
|
}
|