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
1.Fix bug </br>

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

@ -19,6 +19,7 @@ public class FriendshipManager: BaseServiceManager {
self["deleteFriend"] = deleteFriend
self["acceptFriendApplication"] = acceptFriendApplication
self["refuseFriendApplication"] = refuseFriendApplication
self["searchFriends"] = searchFriends
// self["forceSyncFriendApplication"] = forceSyncFriendApplication
// self["forceSyncFriend"] = forceSyncFriend
// self["forceSyncBlackList"] = forceSyncBlackList
@ -81,6 +82,9 @@ public class FriendshipManager: BaseServiceManager {
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){
// Open_im_sdkForceSyncFriendApplication()
// callBack(result)

@ -26,6 +26,7 @@ public class GroupManager: BaseServiceManager {
self["changeGroupMemberMute"] = changeGroupMemberMute
self["setGroupMemberNickname"] = setGroupMemberNickname
self["searchGroups"] = searchGroups
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
}
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -115,6 +116,10 @@ public class GroupManager: BaseServiceManager {
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
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 {

@ -10,6 +10,8 @@ public class OrganizationManager: BaseServiceManager {
self["getDepartmentMember"] = getDepartmentMember
self["getUserInDepartment"] = getUserInDepartment
self["getDepartmentMemberAndSubDepartment"] = getDepartmentMemberAndSubDepartment
self["getDepartmentInfo"] = getDepartmentInfo
self["searchOrganization"] = searchOrganization
}
func setOrganizationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -32,6 +34,14 @@ public class OrganizationManager: BaseServiceManager {
func getDepartmentMemberAndSubDepartment(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
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 {

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

@ -206,6 +206,34 @@ class FriendshipManager {
"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) {
param["ManagerName"] = "friendshipManager";
return param;

@ -437,6 +437,26 @@ class GroupManager {
.then(
(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) {
param["ManagerName"] = "groupManager";
return param;

@ -92,6 +92,57 @@ class OrganizationManager {
.then((value) =>
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) {
param["ManagerName"] = "organizationManager";
return param;

@ -84,24 +84,31 @@ class DeptMemberInfo {
String? ex;
String? attachedInfo;
DeptMemberInfo(
{this.userID,
this.nickname,
this.englishName,
this.faceURL,
this.gender,
this.mobile,
this.telephone,
this.birth,
this.email,
this.departmentID,
this.order,
this.position,
this.leader,
this.status,
this.createTime,
this.ex,
this.attachedInfo});
/// 使
String? departmentName;
List<DeptInfo>? parentDepartmentList;
DeptMemberInfo({
this.userID,
this.nickname,
this.englishName,
this.faceURL,
this.gender,
this.mobile,
this.telephone,
this.birth,
this.email,
this.departmentID,
this.order,
this.position,
this.leader,
this.status,
this.createTime,
this.ex,
this.attachedInfo,
this.departmentName,
this.parentDepartmentList,
});
DeptMemberInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
@ -121,6 +128,13 @@ class DeptMemberInfo {
createTime = json['createTime'];
ex = json['ex'];
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() {
@ -142,6 +156,11 @@ class DeptMemberInfo {
data['createTime'] = this.createTime;
data['ex'] = this.ex;
data['attachedInfo'] = this.attachedInfo;
data['departmentName'] = this.departmentName;
if (this.parentDepartmentList != null) {
data['parentDepartmentList'] =
this.parentDepartmentList!.map((v) => v.toJson()).toList();
}
return data;
}
@ -233,3 +252,41 @@ class DeptMemberAndSubDept {
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
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.15.0"
version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.2.0"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
@ -73,7 +73,7 @@ packages:
name: material_color_utilities
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "0.1.4"
meta:
dependency: transitive
description:
@ -87,7 +87,7 @@ packages:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.0"
version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
@ -99,7 +99,7 @@ packages:
name: source_span
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.1"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
@ -134,21 +134,14 @@ packages:
name: test_api
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.3.0"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.1.1"
version: "2.1.2"
sdks:
dart: ">=2.14.0 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=1.20.0"

@ -1,6 +1,6 @@
name: flutter_openim_sdk
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
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter

Loading…
Cancel
Save