Skip to content

Commit 4c7f9e9

Browse files
committed
发送消息增加 roam_ignore_users 参数,增加群组解除禁言功能
1 parent 7c3eec3 commit 4c7f9e9

File tree

6 files changed

+656
-2
lines changed

6 files changed

+656
-2
lines changed

src/main/java/com/easemob/im/api/GroupApi.java

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3845,6 +3845,123 @@ public okhttp3.Call unmuteAllGroupMembersAsync(String groupId, final ApiCallback
38453845
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
38463846
return localVarCall;
38473847
}
3848+
/**
3849+
* Build call for unmuteGroupMember
3850+
* @param groupId (required)
3851+
* @param username (required)
3852+
* @param _callback Callback for upload/download progress
3853+
* @return Call to execute
3854+
* @throws ApiException If fail to serialize the request body object
3855+
* http.response.details
3856+
*/
3857+
public okhttp3.Call unmuteGroupMemberCall(String groupId, String username, final ApiCallback _callback) throws ApiException {
3858+
String basePath = null;
3859+
// Operation Servers
3860+
String[] localBasePaths = new String[] { };
3861+
3862+
// Determine Base Path to Use
3863+
if (localCustomBaseUrl != null){
3864+
basePath = localCustomBaseUrl;
3865+
} else if ( localBasePaths.length > 0 ) {
3866+
basePath = localBasePaths[localHostIndex];
3867+
} else {
3868+
basePath = null;
3869+
}
3870+
3871+
Object localVarPostBody = null;
3872+
3873+
// create path and map variables
3874+
String localVarPath = "/chatgroups/{group_id}/mute/{username}"
3875+
.replace("{" + "group_id" + "}", localVarApiClient.escapeString(groupId.toString()))
3876+
.replace("{" + "username" + "}", localVarApiClient.escapeString(username.toString()));
3877+
3878+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
3879+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
3880+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
3881+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
3882+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
3883+
3884+
final String[] localVarAccepts = {
3885+
"application/json"
3886+
};
3887+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
3888+
if (localVarAccept != null) {
3889+
localVarHeaderParams.put("Accept", localVarAccept);
3890+
}
3891+
3892+
final String[] localVarContentTypes = {
3893+
};
3894+
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
3895+
if (localVarContentType != null) {
3896+
localVarHeaderParams.put("Content-Type", localVarContentType);
3897+
}
3898+
3899+
String[] localVarAuthNames = new String[] { };
3900+
return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
3901+
}
3902+
3903+
@SuppressWarnings("rawtypes")
3904+
private okhttp3.Call unmuteGroupMemberValidateBeforeCall(String groupId, String username, final ApiCallback _callback) throws ApiException {
3905+
// verify the required parameter 'groupId' is set
3906+
if (groupId == null) {
3907+
throw new ApiException("Missing the required parameter 'groupId' when calling unmuteGroupMember(Async)");
3908+
}
3909+
3910+
// verify the required parameter 'username' is set
3911+
if (username == null) {
3912+
throw new ApiException("Missing the required parameter 'username' when calling unmuteGroupMember(Async)");
3913+
}
3914+
3915+
return unmuteGroupMemberCall(groupId, username, _callback);
3916+
3917+
}
3918+
3919+
/**
3920+
* 解除成员禁言
3921+
* 将一个群成员移出禁言列表。移除后,群成员可以在群组中正常发送消息,同时也可以在该群组下的子区中发送消息。。文档介绍:https://doc.easemob.com/document/server-side/group_member_mutelist.html#%E8%A7%A3%E9%99%A4%E6%88%90%E5%91%98%E7%A6%81%E8%A8%80
3922+
* @param groupId (required)
3923+
* @param username (required)
3924+
* @return EMUnmuteGroupMemberResult
3925+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
3926+
* http.response.details
3927+
*/
3928+
public EMUnmuteGroupMemberResult unmuteGroupMember(String groupId, String username) throws ApiException {
3929+
ApiResponse<EMUnmuteGroupMemberResult> localVarResp = unmuteGroupMemberWithHttpInfo(groupId, username);
3930+
return localVarResp.getData();
3931+
}
3932+
3933+
/**
3934+
* 解除成员禁言
3935+
* 将一个群成员移出禁言列表。移除后,群成员可以在群组中正常发送消息,同时也可以在该群组下的子区中发送消息。。文档介绍:https://doc.easemob.com/document/server-side/group_member_mutelist.html#%E8%A7%A3%E9%99%A4%E6%88%90%E5%91%98%E7%A6%81%E8%A8%80
3936+
* @param groupId (required)
3937+
* @param username (required)
3938+
* @return ApiResponse&lt;EMUnmuteGroupMemberResult&gt;
3939+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
3940+
* http.response.details
3941+
*/
3942+
public ApiResponse<EMUnmuteGroupMemberResult> unmuteGroupMemberWithHttpInfo(String groupId, String username) throws ApiException {
3943+
okhttp3.Call localVarCall = unmuteGroupMemberValidateBeforeCall(groupId, username, null);
3944+
Type localVarReturnType = new TypeToken<EMUnmuteGroupMemberResult>(){}.getType();
3945+
return localVarApiClient.execute(localVarCall, localVarReturnType);
3946+
}
3947+
3948+
/**
3949+
* 解除成员禁言 (asynchronously)
3950+
* 将一个群成员移出禁言列表。移除后,群成员可以在群组中正常发送消息,同时也可以在该群组下的子区中发送消息。。文档介绍:https://doc.easemob.com/document/server-side/group_member_mutelist.html#%E8%A7%A3%E9%99%A4%E6%88%90%E5%91%98%E7%A6%81%E8%A8%80
3951+
* @param groupId (required)
3952+
* @param username (required)
3953+
* @param _callback The callback to be executed when the API call finishes
3954+
* @return The request call
3955+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
3956+
* http.response.details
3957+
*/
3958+
public okhttp3.Call unmuteGroupMemberAsync(String groupId, String username, final ApiCallback<EMUnmuteGroupMemberResult> _callback) throws ApiException {
3959+
3960+
okhttp3.Call localVarCall = unmuteGroupMemberValidateBeforeCall(groupId, username, _callback);
3961+
Type localVarReturnType = new TypeToken<EMUnmuteGroupMemberResult>(){}.getType();
3962+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
3963+
return localVarCall;
3964+
}
38483965
/**
38493966
* Build call for uploadGroupShareFile
38503967
* @param groupId (required)

src/main/java/com/easemob/im/api/model/EMCreateMessage.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
/**
5353
* EMCreateMessage
5454
*/
55-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-03-27T17:20:33.693628+08:00[Asia/Shanghai]")
55+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-03-03T21:15:46.103336+08:00[Asia/Shanghai]")
5656
public class EMCreateMessage {
5757
public static final String SERIALIZED_NAME_FROM = "from";
5858
@SerializedName(SERIALIZED_NAME_FROM)
@@ -86,6 +86,10 @@ public class EMCreateMessage {
8686
@SerializedName(SERIALIZED_NAME_CHATROOM_MSG_LEVEL)
8787
private String chatroomMsgLevel;
8888

89+
public static final String SERIALIZED_NAME_ROAM_IGNORE_USERS = "roam_ignore_users";
90+
@SerializedName(SERIALIZED_NAME_ROAM_IGNORE_USERS)
91+
private List<String> roamIgnoreUsers;
92+
8993
public static final String SERIALIZED_NAME_USERS = "users";
9094
@SerializedName(SERIALIZED_NAME_USERS)
9195
private List<String> users;
@@ -269,6 +273,35 @@ public void setChatroomMsgLevel(String chatroomMsgLevel) {
269273
}
270274

271275

276+
public EMCreateMessage roamIgnoreUsers(List<String> roamIgnoreUsers) {
277+
278+
this.roamIgnoreUsers = roamIgnoreUsers;
279+
return this;
280+
}
281+
282+
public EMCreateMessage addRoamIgnoreUsersItem(String roamIgnoreUsersItem) {
283+
if (this.roamIgnoreUsers == null) {
284+
this.roamIgnoreUsers = new ArrayList<>();
285+
}
286+
this.roamIgnoreUsers.add(roamIgnoreUsersItem);
287+
return this;
288+
}
289+
290+
/**
291+
* 设置哪些用户拉漫游消息时拉不到该消息
292+
* @return roamIgnoreUsers
293+
**/
294+
@javax.annotation.Nullable
295+
public List<String> getRoamIgnoreUsers() {
296+
return roamIgnoreUsers;
297+
}
298+
299+
300+
public void setRoamIgnoreUsers(List<String> roamIgnoreUsers) {
301+
this.roamIgnoreUsers = roamIgnoreUsers;
302+
}
303+
304+
272305
public EMCreateMessage users(List<String> users) {
273306

274307
this.users = users;
@@ -316,12 +349,13 @@ public boolean equals(Object o) {
316349
Objects.equals(this.routetype, createMessage.routetype) &&
317350
Objects.equals(this.ext, createMessage.ext) &&
318351
Objects.equals(this.chatroomMsgLevel, createMessage.chatroomMsgLevel) &&
352+
Objects.equals(this.roamIgnoreUsers, createMessage.roamIgnoreUsers) &&
319353
Objects.equals(this.users, createMessage.users);
320354
}
321355

322356
@Override
323357
public int hashCode() {
324-
return Objects.hash(from, to, type, body, syncDevice, routetype, ext, chatroomMsgLevel, users);
358+
return Objects.hash(from, to, type, body, syncDevice, routetype, ext, chatroomMsgLevel, roamIgnoreUsers, users);
325359
}
326360

327361
@Override
@@ -336,6 +370,7 @@ public String toString() {
336370
sb.append(" routetype: ").append(toIndentedString(routetype)).append("\n");
337371
sb.append(" ext: ").append(toIndentedString(ext)).append("\n");
338372
sb.append(" chatroomMsgLevel: ").append(toIndentedString(chatroomMsgLevel)).append("\n");
373+
sb.append(" roamIgnoreUsers: ").append(toIndentedString(roamIgnoreUsers)).append("\n");
339374
sb.append(" users: ").append(toIndentedString(users)).append("\n");
340375
sb.append("}");
341376
return sb.toString();
@@ -367,6 +402,7 @@ private String toIndentedString(Object o) {
367402
openapiFields.add("routetype");
368403
openapiFields.add("ext");
369404
openapiFields.add("chatroom_msg_level");
405+
openapiFields.add("roam_ignore_users");
370406
openapiFields.add("users");
371407

372408
// a set of required properties/fields (JSON key names)
@@ -425,6 +461,10 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
425461
throw new IllegalArgumentException(String.format("Expected the field `chatroom_msg_level` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chatroom_msg_level").toString()));
426462
}
427463
// ensure the optional json data is an array if present
464+
if (jsonObj.get("roam_ignore_users") != null && !jsonObj.get("roam_ignore_users").isJsonNull() && !jsonObj.get("roam_ignore_users").isJsonArray()) {
465+
throw new IllegalArgumentException(String.format("Expected the field `roam_ignore_users` to be an array in the JSON string but got `%s`", jsonObj.get("roam_ignore_users").toString()));
466+
}
467+
// ensure the optional json data is an array if present
428468
if (jsonObj.get("users") != null && !jsonObj.get("users").isJsonNull() && !jsonObj.get("users").isJsonArray()) {
429469
throw new IllegalArgumentException(String.format("Expected the field `users` to be an array in the JSON string but got `%s`", jsonObj.get("users").toString()));
430470
}

0 commit comments

Comments
 (0)