Skip to content

Commit 8ddc440

Browse files
committed
增加批量获取用户属性,获取群组成员数量,获取聊天室成员数量功能
1 parent 5ffe9cb commit 8ddc440

File tree

8 files changed

+855
-53
lines changed

8 files changed

+855
-53
lines changed

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

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4083,4 +4083,111 @@ public okhttp3.Call uploadGroupShareFileAsync(String groupId, File _file, final
40834083
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
40844084
return localVarCall;
40854085
}
4086+
/**
4087+
* Build call for getGroupMemberCount
4088+
* @param groupId (required)
4089+
* @param _callback Callback for upload/download progress
4090+
* @return Call to execute
4091+
* @throws ApiException If fail to serialize the request body object
4092+
* http.response.details
4093+
*/
4094+
public okhttp3.Call getGroupMemberCountCall(@javax.annotation.Nonnull String groupId, final ApiCallback _callback) throws ApiException {
4095+
String basePath = null;
4096+
// Operation Servers
4097+
String[] localBasePaths = new String[] { };
4098+
4099+
// Determine Base Path to Use
4100+
if (localCustomBaseUrl != null){
4101+
basePath = localCustomBaseUrl;
4102+
} else if ( localBasePaths.length > 0 ) {
4103+
basePath = localBasePaths[localHostIndex];
4104+
} else {
4105+
basePath = null;
4106+
}
4107+
4108+
Object localVarPostBody = null;
4109+
4110+
// create path and map variables
4111+
String localVarPath = "/chatgroups/{group_id}/count"
4112+
.replace("{" + "group_id" + "}", localVarApiClient.escapeString(groupId.toString()));
4113+
4114+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
4115+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
4116+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
4117+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
4118+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
4119+
4120+
final String[] localVarAccepts = {
4121+
"application/json"
4122+
};
4123+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
4124+
if (localVarAccept != null) {
4125+
localVarHeaderParams.put("Accept", localVarAccept);
4126+
}
4127+
4128+
final String[] localVarContentTypes = {
4129+
};
4130+
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
4131+
if (localVarContentType != null) {
4132+
localVarHeaderParams.put("Content-Type", localVarContentType);
4133+
}
4134+
4135+
String[] localVarAuthNames = new String[] { };
4136+
return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
4137+
}
4138+
4139+
@SuppressWarnings("rawtypes")
4140+
private okhttp3.Call getGroupMemberCountValidateBeforeCall(@javax.annotation.Nonnull String groupId, final ApiCallback _callback) throws ApiException {
4141+
// verify the required parameter 'groupId' is set
4142+
if (groupId == null) {
4143+
throw new ApiException("Missing the required parameter 'groupId' when calling getGroupMemberCount(Async)");
4144+
}
4145+
4146+
return getGroupMemberCountCall(groupId, _callback);
4147+
4148+
}
4149+
4150+
/**
4151+
* 获取群组成员数量
4152+
* 获取群组成员数量。
4153+
* @param groupId (required)
4154+
* @return EMGetGroupMemberCountResult
4155+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4156+
* http.response.details
4157+
*/
4158+
public EMGetGroupMemberCountResult getGroupMemberCount(@javax.annotation.Nonnull String groupId) throws ApiException {
4159+
ApiResponse<EMGetGroupMemberCountResult> localVarResp = getGroupMemberCountWithHttpInfo(groupId);
4160+
return localVarResp.getData();
4161+
}
4162+
4163+
/**
4164+
* 获取群组成员数量
4165+
* 获取群组成员数量。
4166+
* @param groupId (required)
4167+
* @return ApiResponse&lt;EMGetGroupMemberCountResult&gt;
4168+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
4169+
* http.response.details
4170+
*/
4171+
public ApiResponse<EMGetGroupMemberCountResult> getGroupMemberCountWithHttpInfo(@javax.annotation.Nonnull String groupId) throws ApiException {
4172+
okhttp3.Call localVarCall = getGroupMemberCountValidateBeforeCall(groupId, null);
4173+
Type localVarReturnType = new TypeToken<EMGetGroupMemberCountResult>(){}.getType();
4174+
return localVarApiClient.execute(localVarCall, localVarReturnType);
4175+
}
4176+
4177+
/**
4178+
* 获取群组成员数量 (asynchronously)
4179+
* 获取群组成员数量。
4180+
* @param groupId (required)
4181+
* @param _callback The callback to be executed when the API call finishes
4182+
* @return The request call
4183+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
4184+
* http.response.details
4185+
*/
4186+
public okhttp3.Call getGroupMemberCountAsync(@javax.annotation.Nonnull String groupId, final ApiCallback<EMGetGroupMemberCountResult> _callback) throws ApiException {
4187+
4188+
okhttp3.Call localVarCall = getGroupMemberCountValidateBeforeCall(groupId, _callback);
4189+
Type localVarReturnType = new TypeToken<EMGetGroupMemberCountResult>(){}.getType();
4190+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
4191+
return localVarCall;
4192+
}
40864193
}

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

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,4 +957,106 @@ public okhttp3.Call setUserMetadataAsync(String username, Map<String, String> me
957957
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
958958
return localVarCall;
959959
}
960+
/**
961+
* Build call for getMultipleUserMetadata
962+
* @param emGetMultipleUserMetadata (optional)
963+
* @param _callback Callback for upload/download progress
964+
* @return Call to execute
965+
* @throws ApiException If fail to serialize the request body object
966+
* http.response.details
967+
*/
968+
public okhttp3.Call getMultipleUserMetadataCall(@javax.annotation.Nullable EMGetMultipleUserMetadata emGetMultipleUserMetadata, final ApiCallback _callback) throws ApiException {
969+
String basePath = null;
970+
// Operation Servers
971+
String[] localBasePaths = new String[] { };
972+
973+
// Determine Base Path to Use
974+
if (localCustomBaseUrl != null){
975+
basePath = localCustomBaseUrl;
976+
} else if ( localBasePaths.length > 0 ) {
977+
basePath = localBasePaths[localHostIndex];
978+
} else {
979+
basePath = null;
980+
}
981+
982+
Object localVarPostBody = emGetMultipleUserMetadata;
983+
984+
// create path and map variables
985+
String localVarPath = "/metadata/user/get";
986+
987+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
988+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
989+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
990+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
991+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
992+
993+
final String[] localVarAccepts = {
994+
"application/json"
995+
};
996+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
997+
if (localVarAccept != null) {
998+
localVarHeaderParams.put("Accept", localVarAccept);
999+
}
1000+
1001+
final String[] localVarContentTypes = {
1002+
"application/json"
1003+
};
1004+
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
1005+
if (localVarContentType != null) {
1006+
localVarHeaderParams.put("Content-Type", localVarContentType);
1007+
}
1008+
1009+
String[] localVarAuthNames = new String[] { };
1010+
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
1011+
}
1012+
1013+
@SuppressWarnings("rawtypes")
1014+
private okhttp3.Call getMultipleUserMetadataValidateBeforeCall(@javax.annotation.Nullable EMGetMultipleUserMetadata emGetMultipleUserMetadata, final ApiCallback _callback) throws ApiException {
1015+
return getMultipleUserMetadataCall(emGetMultipleUserMetadata, _callback);
1016+
1017+
}
1018+
1019+
/**
1020+
* 批量获取用户属性
1021+
* 根据指定的用户 ID 列表和属性列表,查询用户属性。如果指定的用户 ID 或用户属性不存在,返回空数据 {}。 每次最多可获取 100 个用户的属性。文档介绍:https://docs-im-beta.easemob.com/document/server-side/userprofile.html#%E8%8E%B7%E5%8F%96-app-%E4%B8%8B%E7%94%A8%E6%88%B7%E5%B1%9E%E6%80%A7%E6%80%BB%E5%A4%A7%E5%B0%8F
1022+
* @param emGetMultipleUserMetadata (optional)
1023+
* @return EMGetMultipleUserMetadataResult
1024+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1025+
* http.response.details
1026+
*/
1027+
public EMGetMultipleUserMetadataResult getMultipleUserMetadata(@javax.annotation.Nullable EMGetMultipleUserMetadata emGetMultipleUserMetadata) throws ApiException {
1028+
ApiResponse<EMGetMultipleUserMetadataResult> localVarResp = getMultipleUserMetadataWithHttpInfo(emGetMultipleUserMetadata);
1029+
return localVarResp.getData();
1030+
}
1031+
1032+
/**
1033+
* 批量获取用户属性
1034+
* 根据指定的用户 ID 列表和属性列表,查询用户属性。如果指定的用户 ID 或用户属性不存在,返回空数据 {}。 每次最多可获取 100 个用户的属性。文档介绍:https://docs-im-beta.easemob.com/document/server-side/userprofile.html#%E8%8E%B7%E5%8F%96-app-%E4%B8%8B%E7%94%A8%E6%88%B7%E5%B1%9E%E6%80%A7%E6%80%BB%E5%A4%A7%E5%B0%8F
1035+
* @param emGetMultipleUserMetadata (optional)
1036+
* @return ApiResponse&lt;EMGetMultipleUserMetadataResult&gt;
1037+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1038+
* http.response.details
1039+
*/
1040+
public ApiResponse<EMGetMultipleUserMetadataResult> getMultipleUserMetadataWithHttpInfo(@javax.annotation.Nullable EMGetMultipleUserMetadata emGetMultipleUserMetadata) throws ApiException {
1041+
okhttp3.Call localVarCall = getMultipleUserMetadataValidateBeforeCall(emGetMultipleUserMetadata, null);
1042+
Type localVarReturnType = new TypeToken<EMGetMultipleUserMetadataResult>(){}.getType();
1043+
return localVarApiClient.execute(localVarCall, localVarReturnType);
1044+
}
1045+
1046+
/**
1047+
* 批量获取用户属性 (asynchronously)
1048+
* 根据指定的用户 ID 列表和属性列表,查询用户属性。如果指定的用户 ID 或用户属性不存在,返回空数据 {}。 每次最多可获取 100 个用户的属性。文档介绍:https://docs-im-beta.easemob.com/document/server-side/userprofile.html#%E8%8E%B7%E5%8F%96-app-%E4%B8%8B%E7%94%A8%E6%88%B7%E5%B1%9E%E6%80%A7%E6%80%BB%E5%A4%A7%E5%B0%8F
1049+
* @param emGetMultipleUserMetadata (optional)
1050+
* @param _callback The callback to be executed when the API call finishes
1051+
* @return The request call
1052+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1053+
* http.response.details
1054+
*/
1055+
public okhttp3.Call getMultipleUserMetadataAsync(@javax.annotation.Nullable EMGetMultipleUserMetadata emGetMultipleUserMetadata, final ApiCallback<EMGetMultipleUserMetadataResult> _callback) throws ApiException {
1056+
1057+
okhttp3.Call localVarCall = getMultipleUserMetadataValidateBeforeCall(emGetMultipleUserMetadata, _callback);
1058+
Type localVarReturnType = new TypeToken<EMGetMultipleUserMetadataResult>(){}.getType();
1059+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
1060+
return localVarCall;
1061+
}
9601062
}

0 commit comments

Comments
 (0)