Unverified Commit cbefe8d4 authored by Yang Libin's avatar Yang Libin Committed by GitHub

fix: msgSeq and msgRandom type (#62)

* fix: msgSeq and msgRandom type * build: release v0.2.8 * docs: add code comments
parent afaf4f21
...@@ -22,7 +22,7 @@ Add the Maven dependency: ...@@ -22,7 +22,7 @@ Add the Maven dependency:
<dependency> <dependency>
<groupId>io.github.doocs</groupId> <groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId> <artifactId>im-server-sdk-java</artifactId>
<version>0.2.7</version> <version>0.2.8</version>
</dependency> </dependency>
``` ```
......
# 介绍 # 介绍
本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.2.7" vertical="top" /> 编写。 本文档基于腾讯云 IM Server SDK Java <Badge type="tip" text="v0.2.8" vertical="top" /> 编写。
## 前提条件 ## 前提条件
......
...@@ -483,7 +483,7 @@ App 管理员通过该接口撤回指定群组的消息,消息需要在漫游 ...@@ -483,7 +483,7 @@ App 管理员通过该接口撤回指定群组的消息,消息需要在漫游
使用示例: 使用示例:
```java ```java
List<MsgSeqItem> msgSeqList = Collections.singletonList(new MsgSeqItem(0)); List<MsgSeqItem> msgSeqList = Collections.singletonList(new MsgSeqItem(0L));
GroupMsgRecallRequest request = GroupMsgRecallRequest.builder() GroupMsgRecallRequest request = GroupMsgRecallRequest.builder()
.groupId("MyFirstGroup") .groupId("MyFirstGroup")
.msgSeqList(msgSeqList) .msgSeqList(msgSeqList)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
TIMTextMsgElement msg = new TIMTextMsgElement("hi, beauty"); TIMTextMsgElement msg = new TIMTextMsgElement("hi, beauty");
List<TIMMsgElement> msgBody = Collections.singletonList(msg); List<TIMMsgElement> msgBody = Collections.singletonList(msg);
ImPushRequest request = ImPushRequest.builder() ImPushRequest request = ImPushRequest.builder()
.msgRandom(9312457) .msgRandom(9312457L)
.msgBody(msgBody) .msgBody(msgBody)
.fromAccount("admin") .fromAccount("admin")
.msgLifeTime(120) .msgLifeTime(120)
......
...@@ -16,7 +16,7 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg); ...@@ -16,7 +16,7 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg);
SendMsgRequest request = SendMsgRequest.builder() SendMsgRequest request = SendMsgRequest.builder()
.fromAccount("test1") .fromAccount("test1")
.toAccount("test2") .toAccount("test2")
.msgRandom(123) .msgRandom(123L)
.msgBody(msgBody) .msgBody(msgBody)
.syncOtherMachine(SyncOtherMachine.YES) .syncOtherMachine(SyncOtherMachine.YES)
.msgTimeStamp(1631934058) .msgTimeStamp(1631934058)
...@@ -46,10 +46,10 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg); ...@@ -46,10 +46,10 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg);
BatchSendMsgRequest request = BatchSendMsgRequest BatchSendMsgRequest request = BatchSendMsgRequest
.builder() .builder()
.toAccount(toAccount) .toAccount(toAccount)
.msgRandom(123) .msgRandom(123L)
.msgBody(msgBody) .msgBody(msgBody)
.syncOtherMachine(SyncOtherMachine.NO) .syncOtherMachine(SyncOtherMachine.NO)
.msgSeq(28460) .msgSeq(28460L)
.build(); .build();
BatchSendMsgResult result = client.message.batchSendMsg(request); BatchSendMsgResult result = client.message.batchSendMsg(request);
...@@ -73,7 +73,7 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg); ...@@ -73,7 +73,7 @@ List<TIMMsgElement> msgBody = Collections.singletonList(msg);
ImportMsgRequest request = ImportMsgRequest.builder() ImportMsgRequest request = ImportMsgRequest.builder()
.fromAccount("bingo") .fromAccount("bingo")
.toAccount("test1") .toAccount("test1")
.msgRandom(122) .msgRandom(122L)
.msgTimeStamp(1557387418) .msgTimeStamp(1557387418)
.msgBody(msgBody) .msgBody(msgBody)
.build(); .build();
......
...@@ -10,14 +10,14 @@ ...@@ -10,14 +10,14 @@
<dependency> <dependency>
<groupId>io.github.doocs</groupId> <groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId> <artifactId>im-server-sdk-java</artifactId>
<version>0.2.7</version> <version>0.2.8</version>
</dependency> </dependency>
``` ```
### Gradle ### Gradle
```gradle ```gradle
implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.2.7' implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.2.8'
``` ```
### 下载 jar ### 下载 jar
......
{ {
"name": "qcloud-im-server-sdk-java", "name": "qcloud-im-server-sdk-java",
"version": "1.0.0", "version": "0.2.8",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "qcloud-im-server-sdk-java", "name": "qcloud-im-server-sdk-java",
"version": "1.0.0", "version": "0.2.8",
"description": "腾讯云 IM 服务端 SDK API 文档 Java 版", "description": "腾讯云 IM 服务端 SDK API 文档 Java 版",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<groupId>io.github.doocs</groupId> <groupId>io.github.doocs</groupId>
<artifactId>im-server-sdk-java</artifactId> <artifactId>im-server-sdk-java</artifactId>
<version>0.2.7</version> <version>0.2.8</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>qcloud-im-server-sdk-java</name> <name>qcloud-im-server-sdk-java</name>
......
...@@ -20,8 +20,11 @@ public class MemberProfile { ...@@ -20,8 +20,11 @@ public class MemberProfile {
@JsonProperty("JoinTime") @JsonProperty("JoinTime")
private Integer joinTime; private Integer joinTime;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
@JsonProperty("MsgFlag") @JsonProperty("MsgFlag")
private String msgFlag; private String msgFlag;
...@@ -41,7 +44,7 @@ public class MemberProfile { ...@@ -41,7 +44,7 @@ public class MemberProfile {
public MemberProfile() { public MemberProfile() {
} }
public MemberProfile(String memberAccount, String role, Integer joinTime, Integer msgSeq, public MemberProfile(String memberAccount, String role, Integer joinTime, Long msgSeq,
String msgFlag, Integer lastSendMsgTime, Integer shutUpUntil, String nameCard, String msgFlag, Integer lastSendMsgTime, Integer shutUpUntil, String nameCard,
List<AppMemberDefinedDataItem> appMemberDefinedData) { List<AppMemberDefinedDataItem> appMemberDefinedData) {
this.memberAccount = memberAccount; this.memberAccount = memberAccount;
...@@ -95,11 +98,11 @@ public class MemberProfile { ...@@ -95,11 +98,11 @@ public class MemberProfile {
this.joinTime = joinTime; this.joinTime = joinTime;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
...@@ -162,7 +165,10 @@ public class MemberProfile { ...@@ -162,7 +165,10 @@ public class MemberProfile {
private String memberAccount; private String memberAccount;
private String role; private String role;
private Integer joinTime; private Integer joinTime;
private Integer msgSeq; /**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgSeq;
private String msgFlag; private String msgFlag;
private Integer lastSendMsgTime; private Integer lastSendMsgTime;
private Integer shutUpUntil; private Integer shutUpUntil;
...@@ -191,7 +197,7 @@ public class MemberProfile { ...@@ -191,7 +197,7 @@ public class MemberProfile {
return this; return this;
} }
public Builder msgSeq(Integer msgSeq) { public Builder msgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
return this; return this;
} }
......
...@@ -21,11 +21,17 @@ public class BatchSendMsgRequest { ...@@ -21,11 +21,17 @@ public class BatchSendMsgRequest {
@JsonProperty("To_Account") @JsonProperty("To_Account")
private List<String> toAccount; private List<String> toAccount;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
@JsonProperty("MsgBody") @JsonProperty("MsgBody")
private List<TIMMsgElement> msgBody; private List<TIMMsgElement> msgBody;
...@@ -42,14 +48,14 @@ public class BatchSendMsgRequest { ...@@ -42,14 +48,14 @@ public class BatchSendMsgRequest {
public BatchSendMsgRequest() { public BatchSendMsgRequest() {
} }
public BatchSendMsgRequest(List<String> toAccount, Integer msgRandom, List<TIMMsgElement> msgBody) { public BatchSendMsgRequest(List<String> toAccount, Long msgRandom, List<TIMMsgElement> msgBody) {
this.toAccount = toAccount; this.toAccount = toAccount;
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
this.msgBody = msgBody; this.msgBody = msgBody;
} }
public BatchSendMsgRequest(Integer syncOtherMachine, String fromAccount, List<String> toAccount, Integer msgSeq, public BatchSendMsgRequest(Integer syncOtherMachine, String fromAccount, List<String> toAccount, Long msgSeq,
Integer msgRandom, List<TIMMsgElement> msgBody, String cloudCustomData, Long msgRandom, List<TIMMsgElement> msgBody, String cloudCustomData,
List<String> sendMsgControl, OfflinePushInfo offlinePushInfo) { List<String> sendMsgControl, OfflinePushInfo offlinePushInfo) {
this.syncOtherMachine = syncOtherMachine; this.syncOtherMachine = syncOtherMachine;
this.fromAccount = fromAccount; this.fromAccount = fromAccount;
...@@ -102,19 +108,19 @@ public class BatchSendMsgRequest { ...@@ -102,19 +108,19 @@ public class BatchSendMsgRequest {
this.toAccount = toAccount; this.toAccount = toAccount;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
...@@ -150,13 +156,18 @@ public class BatchSendMsgRequest { ...@@ -150,13 +156,18 @@ public class BatchSendMsgRequest {
this.offlinePushInfo = offlinePushInfo; this.offlinePushInfo = offlinePushInfo;
} }
public static final class Builder { public static final class Builder {
private Integer syncOtherMachine; private Integer syncOtherMachine;
private String fromAccount; private String fromAccount;
private List<String> toAccount; private List<String> toAccount;
private Integer msgSeq; /**
private Integer msgRandom; * 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgRandom;
private List<TIMMsgElement> msgBody; private List<TIMMsgElement> msgBody;
private String cloudCustomData; private String cloudCustomData;
private List<String> sendMsgControl; private List<String> sendMsgControl;
...@@ -184,12 +195,12 @@ public class BatchSendMsgRequest { ...@@ -184,12 +195,12 @@ public class BatchSendMsgRequest {
return this; return this;
} }
public Builder msgSeq(Integer msgSeq) { public Builder msgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
return this; return this;
} }
public Builder msgRandom(Integer msgRandom) { public Builder msgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
return this; return this;
} }
......
...@@ -17,7 +17,7 @@ public class ImPushRequest extends GenericRequest { ...@@ -17,7 +17,7 @@ public class ImPushRequest extends GenericRequest {
private Map<String, Object> condition; private Map<String, Object> condition;
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
@JsonProperty("MsgBody") @JsonProperty("MsgBody")
private List<TIMMsgElement> msgBody; private List<TIMMsgElement> msgBody;
...@@ -34,12 +34,12 @@ public class ImPushRequest extends GenericRequest { ...@@ -34,12 +34,12 @@ public class ImPushRequest extends GenericRequest {
public ImPushRequest() { public ImPushRequest() {
} }
public ImPushRequest(Integer msgRandom, List<TIMMsgElement> msgBody) { public ImPushRequest(Long msgRandom, List<TIMMsgElement> msgBody) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
this.msgBody = msgBody; this.msgBody = msgBody;
} }
public ImPushRequest(Map<String, Object> condition, Integer msgRandom, List<TIMMsgElement> msgBody, public ImPushRequest(Map<String, Object> condition, Long msgRandom, List<TIMMsgElement> msgBody,
Integer msgLifeTime, String fromAccount, OfflinePushInfo offlinePushInfo) { Integer msgLifeTime, String fromAccount, OfflinePushInfo offlinePushInfo) {
this.condition = condition; this.condition = condition;
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
...@@ -70,11 +70,11 @@ public class ImPushRequest extends GenericRequest { ...@@ -70,11 +70,11 @@ public class ImPushRequest extends GenericRequest {
this.condition = condition; this.condition = condition;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
...@@ -113,7 +113,10 @@ public class ImPushRequest extends GenericRequest { ...@@ -113,7 +113,10 @@ public class ImPushRequest extends GenericRequest {
public static final class Builder { public static final class Builder {
private Map<String, Object> condition; private Map<String, Object> condition;
private Integer msgRandom; /**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgRandom;
private List<TIMMsgElement> msgBody; private List<TIMMsgElement> msgBody;
private Integer msgLifeTime; private Integer msgLifeTime;
private String fromAccount; private String fromAccount;
...@@ -131,7 +134,7 @@ public class ImPushRequest extends GenericRequest { ...@@ -131,7 +134,7 @@ public class ImPushRequest extends GenericRequest {
return this; return this;
} }
public Builder msgRandom(Integer msgRandom) { public Builder msgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
return this; return this;
} }
......
...@@ -21,11 +21,17 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -21,11 +21,17 @@ public class ImportMsgRequest extends GenericRequest {
@JsonProperty("To_Account") @JsonProperty("To_Account")
private String toAccount; private String toAccount;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
@JsonProperty("MsgTimeStamp") @JsonProperty("MsgTimeStamp")
private Integer msgTimeStamp; private Integer msgTimeStamp;
...@@ -39,7 +45,7 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -39,7 +45,7 @@ public class ImportMsgRequest extends GenericRequest {
public ImportMsgRequest() { public ImportMsgRequest() {
} }
public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount, Integer msgRandom, public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount, Long msgRandom,
Integer msgTimeStamp, List<TIMMsgElement> msgBody) { Integer msgTimeStamp, List<TIMMsgElement> msgBody) {
this.syncFromOldSystem = syncFromOldSystem; this.syncFromOldSystem = syncFromOldSystem;
this.fromAccount = fromAccount; this.fromAccount = fromAccount;
...@@ -49,8 +55,8 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -49,8 +55,8 @@ public class ImportMsgRequest extends GenericRequest {
this.msgBody = msgBody; this.msgBody = msgBody;
} }
public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount, Integer msgSeq, public ImportMsgRequest(Integer syncFromOldSystem, String fromAccount, String toAccount, Long msgSeq,
Integer msgRandom, Integer msgTimeStamp, List<TIMMsgElement> msgBody, String cloudCustomData) { Long msgRandom, Integer msgTimeStamp, List<TIMMsgElement> msgBody, String cloudCustomData) {
this.syncFromOldSystem = syncFromOldSystem; this.syncFromOldSystem = syncFromOldSystem;
this.fromAccount = fromAccount; this.fromAccount = fromAccount;
this.toAccount = toAccount; this.toAccount = toAccount;
...@@ -100,19 +106,19 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -100,19 +106,19 @@ public class ImportMsgRequest extends GenericRequest {
this.toAccount = toAccount; this.toAccount = toAccount;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
...@@ -140,13 +146,18 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -140,13 +146,18 @@ public class ImportMsgRequest extends GenericRequest {
this.cloudCustomData = cloudCustomData; this.cloudCustomData = cloudCustomData;
} }
public static final class Builder { public static final class Builder {
private Integer syncFromOldSystem; private Integer syncFromOldSystem;
private String fromAccount; private String fromAccount;
private String toAccount; private String toAccount;
private Integer msgSeq; /**
private Integer msgRandom; * 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgRandom;
private Integer msgTimeStamp; private Integer msgTimeStamp;
private List<TIMMsgElement> msgBody; private List<TIMMsgElement> msgBody;
private String cloudCustomData; private String cloudCustomData;
...@@ -173,12 +184,12 @@ public class ImportMsgRequest extends GenericRequest { ...@@ -173,12 +184,12 @@ public class ImportMsgRequest extends GenericRequest {
return this; return this;
} }
public Builder msgSeq(Integer msgSeq) { public Builder msgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
return this; return this;
} }
public Builder msgRandom(Integer msgRandom) { public Builder msgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
return this; return this;
} }
......
...@@ -9,13 +9,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -9,13 +9,16 @@ import com.fasterxml.jackson.annotation.JsonProperty;
*/ */
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public class MsgSeqItem { public class MsgSeqItem {
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
public MsgSeqItem() { public MsgSeqItem() {
} }
public MsgSeqItem(Integer msgSeq) { public MsgSeqItem(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
...@@ -27,17 +30,20 @@ public class MsgSeqItem { ...@@ -27,17 +30,20 @@ public class MsgSeqItem {
return new Builder(); return new Builder();
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
public static final class Builder { public static final class Builder {
private Integer msgSeq; /**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgSeq;
private Builder() { private Builder() {
} }
...@@ -46,7 +52,7 @@ public class MsgSeqItem { ...@@ -46,7 +52,7 @@ public class MsgSeqItem {
return new MsgSeqItem(this); return new MsgSeqItem(this);
} }
public Builder msgSeq(Integer msgSeq) { public Builder msgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
return this; return this;
} }
......
...@@ -24,11 +24,14 @@ public class SendMsgRequest extends GenericRequest { ...@@ -24,11 +24,14 @@ public class SendMsgRequest extends GenericRequest {
@JsonProperty("MsgLifeTime") @JsonProperty("MsgLifeTime")
private Integer msgLifeTime; private Integer msgLifeTime;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
@JsonProperty("MsgTimeStamp") @JsonProperty("MsgTimeStamp")
private Integer msgTimeStamp; private Integer msgTimeStamp;
...@@ -51,14 +54,14 @@ public class SendMsgRequest extends GenericRequest { ...@@ -51,14 +54,14 @@ public class SendMsgRequest extends GenericRequest {
public SendMsgRequest() { public SendMsgRequest() {
} }
public SendMsgRequest(String toAccount, Integer msgRandom, List<TIMMsgElement> msgBody) { public SendMsgRequest(String toAccount, Long msgRandom, List<TIMMsgElement> msgBody) {
this.toAccount = toAccount; this.toAccount = toAccount;
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
this.msgBody = msgBody; this.msgBody = msgBody;
} }
public SendMsgRequest(Integer syncOtherMachine, String fromAccount, String toAccount, Integer msgLifeTime, public SendMsgRequest(Integer syncOtherMachine, String fromAccount, String toAccount, Integer msgLifeTime,
Integer msgSeq, Integer msgRandom, Integer msgTimeStamp, List<String> forbidCallbackControl, Long msgSeq, Long msgRandom, Integer msgTimeStamp, List<String> forbidCallbackControl,
List<String> sendMsgControl, List<TIMMsgElement> msgBody, String cloudCustomData, List<String> sendMsgControl, List<TIMMsgElement> msgBody, String cloudCustomData,
OfflinePushInfo offlinePushInfo) { OfflinePushInfo offlinePushInfo) {
this.syncOtherMachine = syncOtherMachine; this.syncOtherMachine = syncOtherMachine;
...@@ -126,19 +129,19 @@ public class SendMsgRequest extends GenericRequest { ...@@ -126,19 +129,19 @@ public class SendMsgRequest extends GenericRequest {
this.msgLifeTime = msgLifeTime; this.msgLifeTime = msgLifeTime;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
...@@ -196,8 +199,14 @@ public class SendMsgRequest extends GenericRequest { ...@@ -196,8 +199,14 @@ public class SendMsgRequest extends GenericRequest {
private String fromAccount; private String fromAccount;
private String toAccount; private String toAccount;
private Integer msgLifeTime; private Integer msgLifeTime;
private Integer msgSeq; /**
private Integer msgRandom; * 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
private Long msgRandom;
private Integer msgTimeStamp; private Integer msgTimeStamp;
private List<String> forbidCallbackControl; private List<String> forbidCallbackControl;
private List<String> sendMsgControl; private List<String> sendMsgControl;
...@@ -232,12 +241,12 @@ public class SendMsgRequest extends GenericRequest { ...@@ -232,12 +241,12 @@ public class SendMsgRequest extends GenericRequest {
return this; return this;
} }
public Builder msgSeq(Integer msgSeq) { public Builder msgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
return this; return this;
} }
public Builder msgRandom(Integer msgRandom) { public Builder msgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
return this; return this;
} }
......
...@@ -7,8 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -7,8 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @since 2021/8/4 11:46 * @since 2021/8/4 11:46
*/ */
public class ImportMsgResultItem { public class ImportMsgResultItem {
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
@JsonProperty("MsgTime") @JsonProperty("MsgTime")
private Integer msgTime; private Integer msgTime;
...@@ -16,11 +19,11 @@ public class ImportMsgResultItem { ...@@ -16,11 +19,11 @@ public class ImportMsgResultItem {
@JsonProperty("Result") @JsonProperty("Result")
private Integer result; private Integer result;
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
......
...@@ -16,11 +16,17 @@ public class MsgListItem { ...@@ -16,11 +16,17 @@ public class MsgListItem {
@JsonProperty("To_Account") @JsonProperty("To_Account")
private String toAccount; private String toAccount;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
@JsonProperty("MsgTimeStamp") @JsonProperty("MsgTimeStamp")
private Integer msgTimeStamp; private Integer msgTimeStamp;
...@@ -53,19 +59,19 @@ public class MsgListItem { ...@@ -53,19 +59,19 @@ public class MsgListItem {
this.toAccount = toAccount; this.toAccount = toAccount;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
......
...@@ -7,12 +7,31 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -7,12 +7,31 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* @since 2021/8/4 11:41 * @since 2021/8/4 11:41
*/ */
public class RecallRetItem { public class RecallRetItem {
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
@JsonProperty("RetCode") @JsonProperty("RetCode")
private Integer retCode; private Integer retCode;
public Long getMsgSeq() {
return msgSeq;
}
public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq;
}
public Integer getRetCode() {
return retCode;
}
public void setRetCode(Integer retCode) {
this.retCode = retCode;
}
@Override @Override
public String toString() { public String toString() {
return "RecallRetItem{" + return "RecallRetItem{" +
......
...@@ -22,11 +22,17 @@ public class RspMsgItem { ...@@ -22,11 +22,17 @@ public class RspMsgItem {
@JsonProperty("MsgPriority") @JsonProperty("MsgPriority")
private Integer msgPriority; private Integer msgPriority;
/**
* 消息随机数,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgRandom") @JsonProperty("MsgRandom")
private Integer msgRandom; private Long msgRandom;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("MsgSeq") @JsonProperty("MsgSeq")
private Integer msgSeq; private Long msgSeq;
@JsonProperty("MsgTimeStamp") @JsonProperty("MsgTimeStamp")
private Integer msgTimeStamp; private Integer msgTimeStamp;
...@@ -63,19 +69,19 @@ public class RspMsgItem { ...@@ -63,19 +69,19 @@ public class RspMsgItem {
this.msgPriority = msgPriority; this.msgPriority = msgPriority;
} }
public Integer getMsgRandom() { public Long getMsgRandom() {
return msgRandom; return msgRandom;
} }
public void setMsgRandom(Integer msgRandom) { public void setMsgRandom(Long msgRandom) {
this.msgRandom = msgRandom; this.msgRandom = msgRandom;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
......
...@@ -10,8 +10,11 @@ public class SendGroupMsgResult extends GenericResult { ...@@ -10,8 +10,11 @@ public class SendGroupMsgResult extends GenericResult {
@JsonProperty("MsgTime") @JsonProperty("MsgTime")
private Integer msgTime; private Integer msgTime;
/**
* 消息序列号,用于标记该条消息,数据范围 [0,4294967295]
*/
@JsonProperty("msgSeq") @JsonProperty("msgSeq")
private Integer msgSeq; private Long msgSeq;
public Integer getMsgTime() { public Integer getMsgTime() {
return msgTime; return msgTime;
...@@ -21,11 +24,11 @@ public class SendGroupMsgResult extends GenericResult { ...@@ -21,11 +24,11 @@ public class SendGroupMsgResult extends GenericResult {
this.msgTime = msgTime; this.msgTime = msgTime;
} }
public Integer getMsgSeq() { public Long getMsgSeq() {
return msgSeq; return msgSeq;
} }
public void setMsgSeq(Integer msgSeq) { public void setMsgSeq(Long msgSeq) {
this.msgSeq = msgSeq; this.msgSeq = msgSeq;
} }
......
...@@ -247,7 +247,7 @@ public class GroupTest { ...@@ -247,7 +247,7 @@ public class GroupTest {
@Test @Test
public void testGroupMsgRecall() throws IOException { public void testGroupMsgRecall() throws IOException {
List<MsgSeqItem> msgSeqList = Collections.singletonList(new MsgSeqItem(0)); List<MsgSeqItem> msgSeqList = Collections.singletonList(new MsgSeqItem(0L));
GroupMsgRecallRequest request = GroupMsgRecallRequest.builder() GroupMsgRecallRequest request = GroupMsgRecallRequest.builder()
.groupId("MyFirstGroup") .groupId("MyFirstGroup")
.msgSeqList(msgSeqList) .msgSeqList(msgSeqList)
......
...@@ -37,7 +37,7 @@ public class MemberTest { ...@@ -37,7 +37,7 @@ public class MemberTest {
TIMTextMsgElement msg = new TIMTextMsgElement("hi, beauty"); TIMTextMsgElement msg = new TIMTextMsgElement("hi, beauty");
List<TIMMsgElement> msgBody = Collections.singletonList(msg); List<TIMMsgElement> msgBody = Collections.singletonList(msg);
ImPushRequest request = ImPushRequest.builder() ImPushRequest request = ImPushRequest.builder()
.msgRandom(9312457) .msgRandom(9312457L)
.msgBody(msgBody) .msgBody(msgBody)
.fromAccount("admin") .fromAccount("admin")
.msgLifeTime(120) .msgLifeTime(120)
......
...@@ -42,7 +42,7 @@ public class MessageTest { ...@@ -42,7 +42,7 @@ public class MessageTest {
SendMsgRequest request = SendMsgRequest.builder() SendMsgRequest request = SendMsgRequest.builder()
.fromAccount("test1") .fromAccount("test1")
.toAccount("test2") .toAccount("test2")
.msgRandom(123) .msgRandom(123L)
.msgBody(msgBody) .msgBody(msgBody)
.syncOtherMachine(SyncOtherMachine.YES) .syncOtherMachine(SyncOtherMachine.YES)
.msgTimeStamp(1631934058) .msgTimeStamp(1631934058)
...@@ -62,10 +62,10 @@ public class MessageTest { ...@@ -62,10 +62,10 @@ public class MessageTest {
BatchSendMsgRequest request = BatchSendMsgRequest BatchSendMsgRequest request = BatchSendMsgRequest
.builder() .builder()
.toAccount(toAccount) .toAccount(toAccount)
.msgRandom(123) .msgRandom(123L)
.msgBody(msgBody) .msgBody(msgBody)
.syncOtherMachine(SyncOtherMachine.NO) .syncOtherMachine(SyncOtherMachine.NO)
.msgSeq(28460) .msgSeq(28460L)
.build(); .build();
BatchSendMsgResult result = client.message.batchSendMsg(request); BatchSendMsgResult result = client.message.batchSendMsg(request);
System.out.println(result); System.out.println(result);
...@@ -79,7 +79,7 @@ public class MessageTest { ...@@ -79,7 +79,7 @@ public class MessageTest {
ImportMsgRequest request = ImportMsgRequest.builder() ImportMsgRequest request = ImportMsgRequest.builder()
.fromAccount("bingo") .fromAccount("bingo")
.toAccount("test1") .toAccount("test1")
.msgRandom(122) .msgRandom(122L)
.msgTimeStamp(1557387418) .msgTimeStamp(1557387418)
.msgBody(msgBody) .msgBody(msgBody)
.build(); .build();
......
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