NIMSDK-AOS 10.4.0-beta
载入中...
搜索中...
未找到
QChatGetMessageHistoryParam.java
浏览该文件的文档.
1package com.netease.nimlib.sdk.qchat.param;
2
3import androidx.annotation.NonNull;
4
5/**
6 * "查询历史消息"接口入参
7 */
9
10 /**
11 * 服务器Id
12 */
13 @NonNull
14 private final Long serverId;
15 /**
16 * 频道Id
17 */
18 @NonNull
19 private final Long channelId;
20 /**
21 * 起始时间
22 */
23 private Long fromTime;
24 /**
25 * 结束时间
26 */
27 private Long toTime;
28 /**
29 * excludeMsgId,排除消息id
30 */
31 private Long excludeMessageId;
32 /**
33 * limit,条数限制,默认100
34 */
35 private Integer limit;
36 /**
37 * reverse,是否反向
38 */
39 private Boolean reverse = false;
40 /**
41 * includeLocalMessages,是否包含本地发送失败的消息
42 * 注意:如果设置为true后,以本地消息的时间戳作为查询边界时,该条消息可能会被重复查询。注意去重。
43 */
44 private Boolean includeLocalMessages = false;
45
46 /**
47 *
48 * @param serverId 服务器Id
49 * @param channelId 频道Id
50 */
51 public QChatGetMessageHistoryParam(long serverId, long channelId) {
52 this.serverId = serverId;
53 this.channelId = channelId;
54 }
55
56 /**
57 * 获取服务器Id
58 * @return
59 */
60 @NonNull
61 public Long getServerId() {
62 return serverId;
63 }
64
65 /**
66 * 获取频道Id
67 * @return
68 */
69 @NonNull
70 public Long getChannelId() {
71 return channelId;
72 }
73
74 /**
75 * 获取起始时间
76 * @return
77 */
78 public Long getFromTime() {
79 return fromTime;
80 }
81
82 /**
83 * 设置起始时间
84 * 如果要查最新的100条,则fromTime=0, toTime=0, limit=0, reverse=0
85 * @param fromTime
86 */
87 public void setFromTime(Long fromTime) {
88 this.fromTime = fromTime;
89 }
90
91 /**
92 * 获取结束时间
93 * @return
94 */
95 public Long getToTime() {
96 return toTime;
97 }
98
99 /**
100 * 设置结束时间
101 * @param toTime
102 */
103 public void setToTime(Long toTime) {
104 this.toTime = toTime;
105 }
106
107 /**
108 * 获取排除消息id
109 * @return
110 */
111 public Long getExcludeMessageId() {
112 return excludeMessageId;
113 }
114
115 /**
116 * 设置排除消息id
117 * @param excludeMsgId
118 */
119 public void setExcludeMessageId(Long excludeMsgId) {
120 this.excludeMessageId = excludeMsgId;
121 }
122
123 /**
124 * 获取条数限制
125 * @return
126 */
127 public Integer getLimit() {
128 return limit;
129 }
130
131 /**
132 * 设置条数限制
133 * @param limit
134 */
135 public void setLimit(Integer limit) {
136 this.limit = limit;
137 }
138
139 /**
140 * 是否反向
141 * @return
142 */
143 public Boolean isReverse() {
144 return reverse;
145 }
146
147 /**
148 * 设置是否反向
149 * @param reverse
150 */
151 public void setReverse(Boolean reverse) {
152 this.reverse = reverse;
153 }
154
155 /**
156 * 是否包含本地发送失败的消息
157 * @return includeLocalMessages
158 */
159 public Boolean isIncludeLocalMessages() {
160 return includeLocalMessages;
161 }
162
163 /**
164 * 设置是否包含本地发送失败的消息
165 * @param includeLocalMessages
166 */
167 public void setIncludeLocalMessages(Boolean includeLocalMessages) {
168 this.includeLocalMessages = includeLocalMessages;
169 }
170}
Boolean isIncludeLocalMessages()
是否包含本地发送失败的消息
void setIncludeLocalMessages(Boolean includeLocalMessages)
设置是否包含本地发送失败的消息
void setFromTime(Long fromTime)
设置起始时间 如果要查最新的100条,则fromTime=0, toTime=0, limit=0, reverse=0