diff --git a/README.md b/README.md index be675c4..90aaadb 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ If you're using Maven, just add the following dependency in `pom.xml`. io.github.doocs im-server-sdk-java - 0.4.06 + 0.4.07 ``` diff --git a/README_CN.md b/README_CN.md index cf46c43..2c5c2c7 100644 --- a/README_CN.md +++ b/README_CN.md @@ -26,7 +26,7 @@ io.github.doocs im-server-sdk-java - 0.4.06 + 0.4.07 ``` diff --git a/docs/guide/README.md b/docs/guide/README.md index 4a10cd1..6501fd5 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -1,6 +1,6 @@ # 介绍 -本文档基于腾讯云 IM Server SDK Java 编写。 +本文档基于腾讯云 IM Server SDK Java 编写。 ## 前提条件 diff --git a/docs/guide/quickstart.md b/docs/guide/quickstart.md index 2b92159..85dab9d 100644 --- a/docs/guide/quickstart.md +++ b/docs/guide/quickstart.md @@ -10,14 +10,14 @@ io.github.doocs im-server-sdk-java - 0.4.06 + 0.4.07 ``` ### Gradle ```gradle -implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.4.06' +implementation group: 'io.github.doocs', name: 'im-server-sdk-java', version: '0.4.07' ``` ### 下载 JAR diff --git a/package-lock.json b/package-lock.json index 958c2c6..fe0e917 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "qcloud-im-server-sdk-java", - "version": "0.4.06", + "version": "0.4.07", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "qcloud-im-server-sdk-java", - "version": "0.4.06", + "version": "0.4.07", "license": "Apache-2.0", "devDependencies": { "@vuepress/bundler-vite": "^2.0.0-rc.13", diff --git a/package.json b/package.json index f4fe588..b3fb2ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qcloud-im-server-sdk-java", - "version": "0.4.06", + "version": "0.4.07", "description": "腾讯云 IM 服务端 SDK API 文档 Java 版", "main": "index.js", "scripts": { diff --git a/pom.xml b/pom.xml index 12deceb..918030c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.doocs im-server-sdk-java - 0.4.06 + 0.4.07 jar qcloud-im-server-sdk-java diff --git a/src/main/java/io/github/doocs/im/model/group/GroupInfo.java b/src/main/java/io/github/doocs/im/model/group/GroupInfo.java index ce92a63..bd4f5a9 100644 --- a/src/main/java/io/github/doocs/im/model/group/GroupInfo.java +++ b/src/main/java/io/github/doocs/im/model/group/GroupInfo.java @@ -114,6 +114,18 @@ public class GroupInfo implements Serializable { @JsonProperty("InviteJoinOption") private String inviteJoinOption; + /** + * 是否启用权限组作为权限判断依据 + */ + @JsonProperty("EnablePermission") + private Integer enablePermission; + + /** + * 群成员拥有的默认权限 + */ + @JsonProperty("DefaultPermission") + private Integer defaultPermission; + /** * 群全员禁言状态 */ @@ -146,7 +158,8 @@ public GroupInfo(String groupId, String type, String name, String introduction, Integer lastInfoTime, Integer lastMsgTime, Long nextMsgSeq, Integer memberNum, Integer maxMemberNum, String applyJoinOption, String inviteJoinOption, String muteAllMember, List appDefinedData, List memberList, - List appMemberDefinedData) { + List appMemberDefinedData, + Integer enablePermission, Integer defaultPermission) { this.groupId = groupId; this.type = type; this.name = name; @@ -167,6 +180,8 @@ public GroupInfo(String groupId, String type, String name, String introduction, this.appDefinedData = appDefinedData; this.memberList = memberList; this.appMemberDefinedData = appMemberDefinedData; + this.enablePermission = enablePermission; + this.defaultPermission = defaultPermission; } private GroupInfo(Builder builder) { @@ -190,6 +205,8 @@ private GroupInfo(Builder builder) { this.appDefinedData = builder.appDefinedData; this.memberList = builder.memberList; this.appMemberDefinedData = builder.appMemberDefinedData; + this.enablePermission = builder.enablePermission; + this.defaultPermission = builder.defaultPermission; } public static Builder builder() { @@ -356,6 +373,21 @@ public void setAppMemberDefinedData(List appMemberDefi this.appMemberDefinedData = appMemberDefinedData; } + public Integer getEnablePermission() { + return enablePermission; + } + + public void setEnablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + } + + public Integer getDefaultPermission() { + return defaultPermission; + } + + public void setDefaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + } public static final class Builder { private String groupId; @@ -378,6 +410,8 @@ public static final class Builder { private List appDefinedData; private List memberList; private List appMemberDefinedData; + private Integer enablePermission; + private Integer defaultPermission; private Builder() { } @@ -485,5 +519,15 @@ public Builder appMemberDefinedData(List appMemberDefi this.appMemberDefinedData = appMemberDefinedData; return this; } + + public Builder enablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + return this; + } + + public Builder defaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/request/ChangeGroupOwnerRequest.java b/src/main/java/io/github/doocs/im/model/request/ChangeGroupOwnerRequest.java index e7e49af..c1522b8 100644 --- a/src/main/java/io/github/doocs/im/model/request/ChangeGroupOwnerRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/ChangeGroupOwnerRequest.java @@ -26,6 +26,12 @@ public class ChangeGroupOwnerRequest extends GenericRequest implements Serializa @JsonProperty("NewOwner_Account") private String newOwnerAccount; + /** + * 指定的操作者账号 + */ + @JsonProperty("From_Account") + private String fromAccount; + public ChangeGroupOwnerRequest() { } @@ -34,9 +40,16 @@ public ChangeGroupOwnerRequest(String groupId, String newOwnerAccount) { this.newOwnerAccount = newOwnerAccount; } + public ChangeGroupOwnerRequest(String groupId, String newOwnerAccount, String fromAccount) { + this.groupId = groupId; + this.newOwnerAccount = newOwnerAccount; + this.fromAccount = fromAccount; + } + private ChangeGroupOwnerRequest(Builder builder) { this.groupId = builder.groupId; this.newOwnerAccount = builder.newOwnerAccount; + this.fromAccount = builder.fromAccount; } public static Builder builder() { @@ -59,10 +72,18 @@ public void setNewOwnerAccount(String newOwnerAccount) { this.newOwnerAccount = newOwnerAccount; } + public String getFromAccount() { + return fromAccount; + } + + public void setFromAccount(String fromAccount) { + this.fromAccount = fromAccount; + } public static final class Builder { private String groupId; private String newOwnerAccount; + private String fromAccount; private Builder() { } @@ -80,5 +101,10 @@ public Builder newOwnerAccount(String newOwnerAccount) { this.newOwnerAccount = newOwnerAccount; return this; } + + public Builder fromAccount(String fromAccount) { + this.fromAccount = fromAccount; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/request/CreateGroupRequest.java b/src/main/java/io/github/doocs/im/model/request/CreateGroupRequest.java index 5ab6c76..0adba17 100644 --- a/src/main/java/io/github/doocs/im/model/request/CreateGroupRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/CreateGroupRequest.java @@ -107,6 +107,22 @@ public class CreateGroupRequest implements Serializable { @JsonProperty("SupportTopic") private Integer supportTopic; + /** + * 仅支持话题的社群可以设置该字段 + * 是否启用权限组作为权限判断依据 + * 0:不启用 + * 1:启用 + */ + @JsonProperty("EnablePermission") + private Integer enablePermission; + + /** + * 仅启用权限组作为权限判断依据的群可以设置该字段 + * 群成员在该群中的默认权限 + */ + @JsonProperty("DefaultPermission") + private Integer defaultPermission; + public CreateGroupRequest() { } @@ -119,7 +135,8 @@ public CreateGroupRequest(String ownerAccount, String type, String groupId, Stri String notification, String faceUrl, Integer maxMemberCount, String applyJoinOption, String inviteJoinOption, List appDefinedData, List memberList, - List appMemberDefinedData, Integer supportTopic) { + List appMemberDefinedData, Integer supportTopic, + Integer enablePermission, Integer defaultPermission) { this.ownerAccount = ownerAccount; this.type = type; this.groupId = groupId; @@ -134,6 +151,8 @@ public CreateGroupRequest(String ownerAccount, String type, String groupId, Stri this.memberList = memberList; this.appMemberDefinedData = appMemberDefinedData; this.supportTopic = supportTopic; + this.enablePermission = enablePermission; + this.defaultPermission = defaultPermission; } private CreateGroupRequest(Builder builder) { @@ -151,6 +170,8 @@ private CreateGroupRequest(Builder builder) { this.memberList = builder.memberList; this.appMemberDefinedData = builder.appMemberDefinedData; this.supportTopic = builder.supportTopic; + this.enablePermission = builder.enablePermission; + this.defaultPermission = builder.defaultPermission; } public static Builder builder() { @@ -269,6 +290,21 @@ public void setSupportTopic(Integer supportTopic) { this.supportTopic = supportTopic; } + public Integer getEnablePermission() { + return enablePermission; + } + + public void setEnablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + } + + public Integer getDefaultPermission() { + return defaultPermission; + } + + public void setDefaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + } public static final class Builder { private String ownerAccount; @@ -285,6 +321,8 @@ public static final class Builder { private List memberList; private List appMemberDefinedData; private Integer supportTopic; + private Integer enablePermission; + private Integer defaultPermission; private Builder() { } @@ -362,5 +400,15 @@ public Builder supportTopic(Integer supportTopic) { this.supportTopic = supportTopic; return this; } + + public Builder enablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + return this; + } + + public Builder defaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/request/GetAppIdGroupListRequest.java b/src/main/java/io/github/doocs/im/model/request/GetAppIdGroupListRequest.java index 93e9568..462500d 100644 --- a/src/main/java/io/github/doocs/im/model/request/GetAppIdGroupListRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/GetAppIdGroupListRequest.java @@ -22,6 +22,8 @@ public class GetAppIdGroupListRequest extends GenericRequest implements Serializ /** * 群太多时分页拉取标志,第一次填0,以后填上一次返回的值,返回的 Next 为0代表拉完了 + * 注意: + * 该数字需为64位无符号整数,如果使用32位整数解析,可能会有溢出问题导致无法完整拉取列表。 */ @JsonProperty("Next") private Long next; diff --git a/src/main/java/io/github/doocs/im/model/request/GetJoinedGroupListRequest.java b/src/main/java/io/github/doocs/im/model/request/GetJoinedGroupListRequest.java index 5569700..1d65dac 100644 --- a/src/main/java/io/github/doocs/im/model/request/GetJoinedGroupListRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/GetJoinedGroupListRequest.java @@ -59,6 +59,12 @@ public class GetJoinedGroupListRequest extends GenericRequest implements Seriali @JsonProperty("ResponseFilter") private ResponseFilter responseFilter; + /** + * 指定查询的是否为支持话题的群组,1表示支持,0表示不支持。如果指定了此字段,则 GroupType 字段必须为 Community。 + */ + @JsonProperty("SupportTopic") + private Integer supportTopic; + public GetJoinedGroupListRequest() { } @@ -67,7 +73,8 @@ public GetJoinedGroupListRequest(String memberAccount) { } public GetJoinedGroupListRequest(String memberAccount, Integer withHugeGroups, Integer withNoActiveGroups, - Integer limit, Integer offset, String groupType, ResponseFilter responseFilter) { + Integer limit, Integer offset, String groupType, ResponseFilter responseFilter, + Integer supportTopic) { this.memberAccount = memberAccount; this.withHugeGroups = withHugeGroups; this.withNoActiveGroups = withNoActiveGroups; @@ -75,6 +82,7 @@ public GetJoinedGroupListRequest(String memberAccount, Integer withHugeGroups, I this.offset = offset; this.groupType = groupType; this.responseFilter = responseFilter; + this.supportTopic = supportTopic; } private GetJoinedGroupListRequest(Builder builder) { @@ -85,6 +93,7 @@ private GetJoinedGroupListRequest(Builder builder) { this.offset = builder.offset; this.groupType = builder.groupType; this.responseFilter = builder.responseFilter; + this.supportTopic = builder.supportTopic; } public static Builder builder() { @@ -147,6 +156,13 @@ public void setResponseFilter(ResponseFilter responseFilter) { this.responseFilter = responseFilter; } + public Integer getSupportTopic() { + return supportTopic; + } + + public void setSupportTopic(Integer supportTopic) { + this.supportTopic = supportTopic; + } public static final class Builder { private String memberAccount; @@ -156,6 +172,7 @@ public static final class Builder { private Integer offset; private String groupType; private ResponseFilter responseFilter; + private Integer supportTopic; private Builder() { } @@ -198,5 +215,10 @@ public Builder responseFilter(ResponseFilter responseFilter) { this.responseFilter = responseFilter; return this; } + + public Builder supportTopic(Integer supportTopic) { + this.supportTopic = supportTopic; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/request/ImportGroupRequest.java b/src/main/java/io/github/doocs/im/model/request/ImportGroupRequest.java index 18f237c..26396b9 100644 --- a/src/main/java/io/github/doocs/im/model/request/ImportGroupRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/ImportGroupRequest.java @@ -85,6 +85,12 @@ public class ImportGroupRequest extends GenericRequest implements Serializable { @JsonProperty("AppDefinedData") private List> appDefinedData; + /** + * 是否支持话题选项,此字段只针对社群有效 + */ + @JsonProperty("SupportTopic") + private Integer supportTopic; + public ImportGroupRequest() { } @@ -95,7 +101,7 @@ public ImportGroupRequest(String type, String name) { public ImportGroupRequest(String ownerAccount, String type, String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberCount, String applyJoinOption, - Integer createTime, List> appDefinedData) { + Integer createTime, List> appDefinedData, Integer supportTopic) { this.ownerAccount = ownerAccount; this.type = type; this.groupId = groupId; @@ -107,6 +113,7 @@ public ImportGroupRequest(String ownerAccount, String type, String groupId, Stri this.applyJoinOption = applyJoinOption; this.createTime = createTime; this.appDefinedData = appDefinedData; + this.supportTopic = supportTopic; } private ImportGroupRequest(Builder builder) { @@ -121,6 +128,7 @@ private ImportGroupRequest(Builder builder) { this.applyJoinOption = builder.applyJoinOption; this.createTime = builder.createTime; this.appDefinedData = builder.appDefinedData; + this.supportTopic = builder.supportTopic; } public static Builder builder() { @@ -215,6 +223,13 @@ public void setAppDefinedData(List> appDefinedData) { this.appDefinedData = appDefinedData; } + public Integer getSupportTopic() { + return supportTopic; + } + + public void setSupportTopic(Integer supportTopic) { + this.supportTopic = supportTopic; + } public static final class Builder { private String ownerAccount; @@ -228,6 +243,7 @@ public static final class Builder { private String applyJoinOption; private Integer createTime; private List> appDefinedData; + private Integer supportTopic; private Builder() { } @@ -290,5 +306,10 @@ public Builder appDefinedData(List> appDefinedData) { this.appDefinedData = appDefinedData; return this; } + + public Builder supportTopic(Integer supportTopic) { + this.supportTopic = supportTopic; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/request/ModifyGroupBaseInfoRequest.java b/src/main/java/io/github/doocs/im/model/request/ModifyGroupBaseInfoRequest.java index 8e730e1..4c0868c 100644 --- a/src/main/java/io/github/doocs/im/model/request/ModifyGroupBaseInfoRequest.java +++ b/src/main/java/io/github/doocs/im/model/request/ModifyGroupBaseInfoRequest.java @@ -69,6 +69,45 @@ public class ModifyGroupBaseInfoRequest extends GenericRequest implements Serial @JsonProperty("MuteAllMember") private String muteAllMember; + /** + * 邀请加群处理方式,包含 + * FreeAccess (直接邀请用户进群,不需要审批等操作), + * NeedPermission 需要群管理员或者群主审批, + * DisableInvite 不支持 SDK 邀请邀请进群, 该选项 AVChatRoom 群类型不支持 + */ + @JsonProperty("InviteJoinOption") + private String inviteJoinOption; + + /** + * 操作者来源账号,选填。如果不填写该字段,则修改群资料的操作者为调用该接口时使用的 App 管理员账号。除此之外,App 亦可通过该字段“伪造”修改群资料的操作者,从而实现一些特殊的功能需求。需要注意的是,如果指定该字段,必须要确保字段中的账号是存在的 + */ + @JsonProperty("From_Account") + private String fromAccount; + + /** + * 仅支持话题的社群可以设置该字段 + * 是否启用权限组作为权限判断依据 + * 0:不启用 + * 1:启用 + */ + @JsonProperty("EnablePermission") + private Integer enablePermission; + + /** + * 仅启用权限组作为权限判断依据的群可以设置该字段 + * 群成员在该群中的默认权限 + */ + @JsonProperty("DefaultPermission") + private Integer defaultPermission; + + /** + * 仅支持 Work,Public, Meeting 群,表示是否支持群成员拉进群前消息。 + * Off:表示关闭 + * On:表示打开 + */ + @JsonProperty("HistoryMsgBeforeJoin") + private String historyMsgBeforeJoin; + /** * 群内群成员禁言,只有群管理员和群主以及系统管理员可以发言 */ @@ -84,7 +123,9 @@ public ModifyGroupBaseInfoRequest(String groupId) { public ModifyGroupBaseInfoRequest(String groupId, String name, String introduction, String notification, String faceUrl, Integer maxMemberNum, String applyJoinOption, - String muteAllMember, List appDefinedData) { + String muteAllMember, List appDefinedData, + String inviteJoinOption, String fromAccount, Integer enablePermission, + Integer defaultPermission, String historyMsgBeforeJoin) { this.groupId = groupId; this.name = name; this.introduction = introduction; @@ -94,6 +135,11 @@ public ModifyGroupBaseInfoRequest(String groupId, String name, String introducti this.applyJoinOption = applyJoinOption; this.muteAllMember = muteAllMember; this.appDefinedData = appDefinedData; + this.inviteJoinOption = inviteJoinOption; + this.fromAccount = fromAccount; + this.enablePermission = enablePermission; + this.defaultPermission = defaultPermission; + this.historyMsgBeforeJoin = historyMsgBeforeJoin; } private ModifyGroupBaseInfoRequest(Builder builder) { @@ -106,6 +152,11 @@ private ModifyGroupBaseInfoRequest(Builder builder) { this.applyJoinOption = builder.applyJoinOption; this.muteAllMember = builder.muteAllMember; this.appDefinedData = builder.appDefinedData; + this.inviteJoinOption = builder.inviteJoinOption; + this.fromAccount = builder.fromAccount; + this.enablePermission = builder.enablePermission; + this.defaultPermission = builder.defaultPermission; + this.historyMsgBeforeJoin = builder.historyMsgBeforeJoin; } public static Builder builder() { @@ -184,6 +235,45 @@ public void setAppDefinedData(List appDefinedData) { this.appDefinedData = appDefinedData; } + public String getInviteJoinOption() { + return inviteJoinOption; + } + + public void setInviteJoinOption(String inviteJoinOption) { + this.inviteJoinOption = inviteJoinOption; + } + + public String getFromAccount() { + return fromAccount; + } + + public void setFromAccount(String fromAccount) { + this.fromAccount = fromAccount; + } + + public Integer getEnablePermission() { + return enablePermission; + } + + public void setEnablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + } + + public Integer getDefaultPermission() { + return defaultPermission; + } + + public void setDefaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + } + + public String getHistoryMsgBeforeJoin() { + return historyMsgBeforeJoin; + } + + public void setHistoryMsgBeforeJoin(String historyMsgBeforeJoin) { + this.historyMsgBeforeJoin = historyMsgBeforeJoin; + } public static final class Builder { private String groupId; @@ -195,6 +285,11 @@ public static final class Builder { private String applyJoinOption; private String muteAllMember; private List appDefinedData; + private String inviteJoinOption; + private String fromAccount; + private Integer enablePermission; + private Integer defaultPermission; + private String historyMsgBeforeJoin; private Builder() { } @@ -247,5 +342,30 @@ public Builder appDefinedData(List appDefinedData) { this.appDefinedData = appDefinedData; return this; } + + public Builder inviteJoinOption(String inviteJoinOption) { + this.inviteJoinOption = inviteJoinOption; + return this; + } + + public Builder fromAccount(String fromAccount) { + this.fromAccount = fromAccount; + return this; + } + + public Builder enablePermission(Integer enablePermission) { + this.enablePermission = enablePermission; + return this; + } + + public Builder defaultPermission(Integer defaultPermission) { + this.defaultPermission = defaultPermission; + return this; + } + + public Builder historyMsgBeforeJoin(String historyMsgBeforeJoin) { + this.historyMsgBeforeJoin = historyMsgBeforeJoin; + return this; + } } } diff --git a/src/main/java/io/github/doocs/im/model/response/CreateGroupResult.java b/src/main/java/io/github/doocs/im/model/response/CreateGroupResult.java index 2b3932a..2c8dabe 100644 --- a/src/main/java/io/github/doocs/im/model/response/CreateGroupResult.java +++ b/src/main/java/io/github/doocs/im/model/response/CreateGroupResult.java @@ -18,6 +18,12 @@ public class CreateGroupResult extends GenericResult implements Serializable { @JsonProperty("GroupId") private String groupId; + @JsonProperty("Type") + private String type; + + @JsonProperty("HugeGroupFlag") + private Integer hugeGroupFlag; + public String getGroupId() { return groupId; } @@ -26,10 +32,28 @@ public void setGroupId(String groupId) { this.groupId = groupId; } + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getHugeGroupFlag() { + return hugeGroupFlag; + } + + public void setHugeGroupFlag(Integer hugeGroupFlag) { + this.hugeGroupFlag = hugeGroupFlag; + } + @Override public String toString() { return "CreateGroupResult{" + "groupId='" + groupId + '\'' + + ", type='" + type + '\'' + + ", hugeGroupFlag=" + hugeGroupFlag + ", actionStatus='" + actionStatus + '\'' + ", errorInfo='" + errorInfo + '\'' + ", errorCode=" + errorCode + diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index 7f6d039..90be61a 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -1 +1 @@ -version=0.4.06 +version=0.4.07