1.Fix bug </br>

2.New searchOrganization method</br>
3.New searchFriends method</br>
4.New getDepartmentInfo method</br>
5.New setGroupMemberRoleLevel method</br>
main
hrxiang 3 years ago
parent 8b1f4dc320
commit ed20b4915a
  1. 8
      CHANGELOG.md
  2. 2
      android/build.gradle
  3. 8
      android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java
  4. 9
      android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java
  5. 18
      android/src/main/java/io/openim/flutter_openim_sdk/manager/OrganizationManager.java
  6. 25
      example/pubspec.lock
  7. 4
      ios/Classes/Module/FriendshipManager.swift
  8. 5
      ios/Classes/Module/GroupManager.swift
  9. 10
      ios/Classes/Module/OrganizationManager.swift
  10. 1
      lib/src/enum/group_at_type.dart
  11. 28
      lib/src/manager/im_friendship_manager.dart
  12. 20
      lib/src/manager/im_group_manager.dart
  13. 51
      lib/src/manager/im_organization_manager.dart
  14. 93
      lib/src/models/organization_info.dart
  15. 23
      pubspec.lock
  16. 2
      pubspec.yaml

@ -1,3 +1,11 @@
## 2.0.9+2
1.Fix bug </br>
2.New searchOrganization method</br>
3.New searchFriends method</br>
4.New getDepartmentInfo method</br>
5.New setGroupMemberRoleLevel method</br>
## 2.0.9+1 ## 2.0.9+1
1.Fix bug </br> 1.Fix bug </br>

@ -41,5 +41,5 @@ android {
} }
} }
dependencies { dependencies {
implementation 'io.openim:core-sdk:2.0.9.10@aar' implementation 'io.openim:core-sdk:2.0.9.18@aar'
} }

@ -112,4 +112,12 @@ public class FriendshipManager extends BaseManager {
jsonValue(methodCall) jsonValue(methodCall)
); );
} }
public void searchFriends(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchFriends(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParam")
);
}
} }

@ -190,4 +190,13 @@ public class GroupManager extends BaseManager {
jsonValue(methodCall, "searchParam") jsonValue(methodCall, "searchParam")
); );
} }
public void setGroupMemberRoleLevel(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupMemberRoleLevel(new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "groupID"),
value(methodCall, "userID"),
int2long(methodCall, "roleLevel")
);
}
} }

@ -47,4 +47,22 @@ public class OrganizationManager extends BaseManager {
value(methodCall, "departmentID") value(methodCall, "departmentID")
); );
} }
public void getDepartmentInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getDepartmentInfo(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
value(methodCall, "departmentID")
);
}
public void searchOrganization(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.searchOrganization(
new OnBaseListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "searchParams"),
int2long(methodCall, "offset"),
int2long(methodCall, "count")
);
}
} }

@ -42,7 +42,7 @@ packages:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -56,7 +56,7 @@ packages:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.3.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -68,7 +68,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "2.0.9" version: "2.0.9+2"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -87,7 +87,7 @@ packages:
name: material_color_utilities name: material_color_utilities
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.3" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -101,7 +101,7 @@ packages:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -113,7 +113,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -148,21 +148,14 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.8" version: "0.4.9"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
sdks: sdks:
dart: ">=2.14.0 <3.0.0" dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"

@ -19,6 +19,7 @@ public class FriendshipManager: BaseServiceManager {
self["deleteFriend"] = deleteFriend self["deleteFriend"] = deleteFriend
self["acceptFriendApplication"] = acceptFriendApplication self["acceptFriendApplication"] = acceptFriendApplication
self["refuseFriendApplication"] = refuseFriendApplication self["refuseFriendApplication"] = refuseFriendApplication
self["searchFriends"] = searchFriends
// self["forceSyncFriendApplication"] = forceSyncFriendApplication // self["forceSyncFriendApplication"] = forceSyncFriendApplication
// self["forceSyncFriend"] = forceSyncFriend // self["forceSyncFriend"] = forceSyncFriend
// self["forceSyncBlackList"] = forceSyncBlackList // self["forceSyncBlackList"] = forceSyncBlackList
@ -81,6 +82,9 @@ public class FriendshipManager: BaseServiceManager {
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
} }
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
}
// func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ // func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
// Open_im_sdkForceSyncFriendApplication() // Open_im_sdkForceSyncFriendApplication()
// callBack(result) // callBack(result)

@ -26,6 +26,7 @@ public class GroupManager: BaseServiceManager {
self["changeGroupMemberMute"] = changeGroupMemberMute self["changeGroupMemberMute"] = changeGroupMemberMute
self["setGroupMemberNickname"] = setGroupMemberNickname self["setGroupMemberNickname"] = setGroupMemberNickname
self["searchGroups"] = searchGroups self["searchGroups"] = searchGroups
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
} }
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -115,6 +116,10 @@ public class GroupManager: BaseServiceManager {
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"]) Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
} }
func setGroupMemberRoleLevel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupMemberRoleLevel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"roleLevel"])
}
} }
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol { public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {

@ -10,6 +10,8 @@ public class OrganizationManager: BaseServiceManager {
self["getDepartmentMember"] = getDepartmentMember self["getDepartmentMember"] = getDepartmentMember
self["getUserInDepartment"] = getUserInDepartment self["getUserInDepartment"] = getUserInDepartment
self["getDepartmentMemberAndSubDepartment"] = getDepartmentMemberAndSubDepartment self["getDepartmentMemberAndSubDepartment"] = getDepartmentMemberAndSubDepartment
self["getDepartmentInfo"] = getDepartmentInfo
self["searchOrganization"] = searchOrganization
} }
func setOrganizationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ func setOrganizationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -32,6 +34,14 @@ public class OrganizationManager: BaseServiceManager {
func getDepartmentMemberAndSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { func getDepartmentMemberAndSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetDepartmentMemberAndSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"]) Open_im_sdkGetDepartmentMemberAndSubDepartment(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
} }
func getDepartmentInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetDepartmentInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "departmentID"])
}
func searchOrganization(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSearchOrganization(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParams"], methodCall[int: "offset"], methodCall[int: "count"])
}
} }
public class OrganizationListener: NSObject, Open_im_sdk_callbackOnOrganizationListenerProtocol { public class OrganizationListener: NSObject, Open_im_sdk_callbackOnOrganizationListenerProtocol {

@ -3,4 +3,5 @@ class GroupAtType {
static const atMe = 1; static const atMe = 1;
static const atAll = 2; static const atAll = 2;
static const atAllAtMe = 3; static const atAllAtMe = 3;
static const groupNotification = 4;
} }

@ -206,6 +206,34 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID), "operationID": Utils.checkOperationID(operationID),
})); }));
/// Search friends
///
/// [keywordList]
/// [isSearchUserID] ID(false)false
/// [isSearchNickname] false
/// [isSearchRemark] false
Future<List<FriendInfo>> searchFriends({
List<String> keywordList = const [],
bool isSearchUserID = false,
bool isSearchNickname = false,
bool isSearchRemark = false,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchFriends',
_buildParam({
'searchParam': {
'keywordList': keywordList,
'isSearchUserID': isSearchUserID,
'isSearchNickname': isSearchNickname,
'isSearchRemark': isSearchRemark,
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => FriendInfo.fromJson(map)));
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "friendshipManager"; param["ManagerName"] = "friendshipManager";
return param; return param;

@ -437,6 +437,26 @@ class GroupManager {
.then( .then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map))); (value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// Set group user role
///
/// [groupID] ID
/// [userID] ID
/// [roleLevel]
Future<dynamic> setGroupMemberRoleLevel({
required String groupID,
required String userID,
required int roleLevel,
String? operationID,
}) =>
_channel.invokeMethod(
'setGroupMemberRoleLevel',
_buildParam({
'groupID': groupID,
'userID': userID,
'roleLevel': roleLevel,
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "groupManager"; param["ManagerName"] = "groupManager";
return param; return param;

@ -92,6 +92,57 @@ class OrganizationManager {
.then((value) => .then((value) =>
Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v))); Utils.toObj(value, (v) => DeptMemberAndSubDept.fromJson(v)));
/// Query department info
///
Future<DeptInfo> getDeptInfo({
required String departmentID,
String? operationID,
}) =>
_channel
.invokeMethod(
'getDepartmentInfo',
_buildParam({
'departmentID': departmentID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (v) => DeptInfo.fromJson(v)));
/// Search
///
Future<OrganizationSearchResult> searchOrganization({
required String keyWord,
bool isSearchUserName = false,
bool isSearchEnglishName = false,
bool isSearchPosition = false,
bool isSearchUserID = false,
bool isSearchMobile = false,
bool isSearchEmail = false,
bool isSearchTelephone = false,
int offset = 0,
int count = 40,
String? operationID,
}) =>
_channel
.invokeMethod(
'searchOrganization',
_buildParam({
'searchParams': {
'keyWord': keyWord,
'isSearchUserName': isSearchUserName,
'isSearchEnglishName': isSearchEnglishName,
'isSearchPosition': isSearchPosition,
'isSearchUserID': isSearchUserID,
'isSearchMobile': isSearchMobile,
'isSearchEmail': isSearchEmail,
'isSearchTelephone': isSearchTelephone,
},
'offset': offset,
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toObj(value, (v) => OrganizationSearchResult.fromJson(v)));
static Map _buildParam(Map param) { static Map _buildParam(Map param) {
param["ManagerName"] = "organizationManager"; param["ManagerName"] = "organizationManager";
return param; return param;

@ -84,24 +84,31 @@ class DeptMemberInfo {
String? ex; String? ex;
String? attachedInfo; String? attachedInfo;
DeptMemberInfo( /// 使
{this.userID, String? departmentName;
this.nickname, List<DeptInfo>? parentDepartmentList;
this.englishName,
this.faceURL, DeptMemberInfo({
this.gender, this.userID,
this.mobile, this.nickname,
this.telephone, this.englishName,
this.birth, this.faceURL,
this.email, this.gender,
this.departmentID, this.mobile,
this.order, this.telephone,
this.position, this.birth,
this.leader, this.email,
this.status, this.departmentID,
this.createTime, this.order,
this.ex, this.position,
this.attachedInfo}); this.leader,
this.status,
this.createTime,
this.ex,
this.attachedInfo,
this.departmentName,
this.parentDepartmentList,
});
DeptMemberInfo.fromJson(Map<String, dynamic> json) { DeptMemberInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID']; userID = json['userID'];
@ -121,6 +128,13 @@ class DeptMemberInfo {
createTime = json['createTime']; createTime = json['createTime'];
ex = json['ex']; ex = json['ex'];
attachedInfo = json['attachedInfo']; attachedInfo = json['attachedInfo'];
departmentName = json['departmentName'];
if (json['parentDepartmentList'] != null) {
parentDepartmentList = <DeptInfo>[];
json['parentDepartmentList'].forEach((v) {
parentDepartmentList!.add(DeptInfo.fromJson(v));
});
}
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -142,6 +156,11 @@ class DeptMemberInfo {
data['createTime'] = this.createTime; data['createTime'] = this.createTime;
data['ex'] = this.ex; data['ex'] = this.ex;
data['attachedInfo'] = this.attachedInfo; data['attachedInfo'] = this.attachedInfo;
data['departmentName'] = this.departmentName;
if (this.parentDepartmentList != null) {
data['parentDepartmentList'] =
this.parentDepartmentList!.map((v) => v.toJson()).toList();
}
return data; return data;
} }
@ -233,3 +252,41 @@ class DeptMemberAndSubDept {
return data; return data;
} }
} }
class OrganizationSearchResult {
List<DeptInfo>? departmentList;
List<DeptMemberInfo>? departmentMemberList;
OrganizationSearchResult({
this.departmentList,
this.departmentMemberList,
});
OrganizationSearchResult.fromJson(Map<String, dynamic> json) {
if (json['departmentList'] != null) {
departmentList = <DeptInfo>[];
json['departmentList'].forEach((v) {
departmentList!.add(DeptInfo.fromJson(v));
});
}
if (json['departmentMemberList'] != null) {
departmentMemberList = <DeptMemberInfo>[];
json['departmentMemberList'].forEach((v) {
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.departmentList != null) {
data['departmentList'] =
this.departmentList!.map((v) => v.toJson()).toList();
}
if (this.departmentMemberList != null) {
data['departmentMemberList'] =
this.departmentMemberList!.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -42,14 +42,14 @@ packages:
name: collection name: collection
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.15.0" version: "1.16.0"
fake_async: fake_async:
dependency: transitive dependency: transitive
description: description:
name: fake_async name: fake_async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.3.0"
flutter: flutter:
dependency: "direct main" dependency: "direct main"
description: flutter description: flutter
@ -73,7 +73,7 @@ packages:
name: material_color_utilities name: material_color_utilities
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.1.3" version: "0.1.4"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -87,7 +87,7 @@ packages:
name: path name: path
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.0" version: "1.8.1"
sky_engine: sky_engine:
dependency: transitive dependency: transitive
description: flutter description: flutter
@ -99,7 +99,7 @@ packages:
name: source_span name: source_span
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.8.1" version: "1.8.2"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -134,21 +134,14 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.4.8" version: "0.4.9"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
name: vector_math name: vector_math
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.1.1" version: "2.1.2"
sdks: sdks:
dart: ">=2.14.0 <3.0.0" dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0" flutter: ">=1.20.0"

@ -1,6 +1,6 @@
name: flutter_openim_sdk name: flutter_openim_sdk
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source. description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
version: 2.0.9+1 version: 2.0.9+2
homepage: https://www.rentsoft.cn homepage: https://www.rentsoft.cn
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter

Loading…
Cancel
Save