liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package com.basic.easemob.mapper;
 
/**
 * 聊天记录
 * 
 * @company 北京贝思科技术有限公司
 * @author liuyajun, 8384503@qq.com
 * @date 2016年1月25日
 * @time 下午2:40:48
 */
public class IMMsg {
/**
 * 
 
聊天记录数据结构
 
{
    "type": "chatmessage",
    "from": "zw123", //发送人username
    "msg_id": "5I02W-16-8278a", //消息id
    "chat_type": "chat", //用来判断单聊还是群聊。chat:单聊,groupchat:群聊
    "payload": {
        "bodies": [ //消息bodies
          {
            "msg": "hhhhhh", //消息内容
            "type": "txt" //消息类型。txt:文本消息, img:图片, loc:位置, audio:语音
            "length": 3, //语音时长,单位为秒,这个属性只有语音消息有
            "url": "", //图片语音等文件的网络url,图片和语音消息有这个属性
            "filename": "22.png", //文件名字,图片和语音消息有这个属性
            "secret": "pCY80PdfEeO4Jh9URCOfMQWU9QYsJytynu4n-yhtvAhmt1g9", //获取文件的secret,图片和语音消息有这个属性
            "lat": 39.983805, //发送的位置的纬度,只有位置消息有这个属性
            "lng": 116.307417, //位置经度,只有位置消息有这个属性
            "addr": "北京市海淀区北四环西路66号" //位置消息详细地址,只有位置消息有这个属性
          }
        ]
            "ext": { //自定义扩展属性
            "key1": "value1",   //你设置的key和value的值
               ...
         },
    },
    "timestamp": 1403099033211, //消息发送时间
    "to": "1402541206787" //接收人的username或者接收group的id
}
 */
    private String msgId;    //消息id
    private String chatType;    //用来判断单聊还是群聊。chat:单聊,groupchat:群聊
    private String from;    //发送人username
    private String to;        //接收人的username或者接收group的id
    private long timestamp;    //1403099033211, //消息发送时间
    private String msgType;    //消息类型。txt:文本消息, img:图片, loc:位置, audio:语音
    private String msgContent;        //消息内容
    private Integer length;    //语音时长,单位为秒,这个属性只有语音消息有
    private String url;    //图片语音等文件的网络url,图片和语音消息有这个属性
    private String fileName;    //"22.png", //文件名字,图片和语音消息有这个属性
    private String secret;        //获取文件的secret,图片和语音消息有这个属性
    private Double addrLat;    ////发送的位置的纬度,只有位置消息有这个属性
    private Double addrLng;    ////位置经度,只有位置消息有这个属性
    private String addr;    //"北京市海淀区北四环西路66号" //位置消息详细地址,只有位置消息有这个属性
    private String ext;
    private String cursor;
    
    public String getMsgType() {
        return msgType;
    }
    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }
    public String getFrom() {
        return from;
    }
    public void setFrom(String from) {
        this.from = from;
    }
    public String getTo() {
        return to;
    }
    public void setTo(String to) {
        this.to = to;
    }
    public long getTimestamp() {
        return timestamp;
    }
    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }
    public String getMsgId() {
        return msgId;
    }
    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }
    public String getChatType() {
        return chatType;
    }
    public void setChatType(String chatType) {
        this.chatType = chatType;
    }
 
 
    public Integer getLength() {
        return length;
    }
    public void setLength(Integer length) {
        this.length = length;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getFileName() {
        return fileName;
    }
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    public String getSecret() {
        return secret;
    }
    public void setSecret(String secret) {
        this.secret = secret;
    }
    public Double getAddrLat() {
        return addrLat;
    }
    public void setAddrLat(Double addrLat) {
        this.addrLat = addrLat;
    }
    public Double getAddrLng() {
        return addrLng;
    }
    public void setAddrLng(Double addrLng) {
        this.addrLng = addrLng;
    }
    public String getAddr() {
        return addr;
    }
    public void setAddr(String addr) {
        this.addr = addr;
    }
 
    public String getMsgContent() {
        return msgContent;
    }
    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }
    public String getExt() {
        return ext;
    }
    public void setExt(String ext) {
        this.ext = ext;
    }
    public String getCursor() {
        return cursor;
    }
    public void setCursor(String cursor) {
        this.cursor = cursor;
    } 
}