init
This commit is contained in:
@@ -9,82 +9,113 @@ class FriendshipManager {
|
||||
|
||||
FriendshipManager(this._channel);
|
||||
|
||||
/// listener[FriendshipListener]
|
||||
///
|
||||
Future setFriendshipListener(FriendshipListener listener) {
|
||||
this.friendshipListener = listener;
|
||||
return _channel.invokeMethod('setFriendListener', _buildParam({}));
|
||||
}
|
||||
|
||||
/// get friend info by userid
|
||||
///
|
||||
Future<List<UserInfo>> getFriendsInfo({required List<String> uidList}) {
|
||||
return _channel
|
||||
.invokeMethod('getFriendsInfo', _buildParam({"uidList": uidList}))
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
/// send an friend application
|
||||
///
|
||||
Future<dynamic> addFriend({required String uid, required String reason}) {
|
||||
return _channel.invokeMethod(
|
||||
'addFriend', _buildParam({"uid": uid, "reqMessage": reason}));
|
||||
}
|
||||
|
||||
/// get all friend application
|
||||
/// including those initiated by you and sent to you by others
|
||||
Future<List<UserInfo>> getFriendApplicationList() {
|
||||
return _channel
|
||||
.invokeMethod('getFriendApplicationList', _buildParam({}))
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
/// find all friends
|
||||
///
|
||||
Future<List<UserInfo>> getFriendList() {
|
||||
return _channel
|
||||
.invokeMethod('getFriendList', _buildParam({}))
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
/// modify friend information, only [comment] can be modified
|
||||
///
|
||||
Future<dynamic> setFriendInfo({required UserInfo info}) {
|
||||
return _channel.invokeMethod('setFriendInfo', _buildParam(info.toJson()));
|
||||
}
|
||||
|
||||
/// add to blacklist
|
||||
///
|
||||
Future<dynamic> addToBlackList({required String uid}) {
|
||||
return _channel.invokeMethod('addToBlackList', _buildParam({"uid": uid}));
|
||||
}
|
||||
|
||||
/// find all blacklist
|
||||
///
|
||||
Future<List<UserInfo>> getBlackList() {
|
||||
return _channel
|
||||
.invokeMethod('getBlackList', _buildParam({}))
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
/// remove from blacklist
|
||||
///
|
||||
Future<dynamic> deleteFromBlackList({required String uid}) {
|
||||
return _channel.invokeMethod(
|
||||
'deleteFromBlackList', _buildParam({"uid": uid}));
|
||||
}
|
||||
|
||||
/// determine if there is a friendship by userId
|
||||
///
|
||||
Future<List<UserInfo>> checkFriend(List<String> uidList) {
|
||||
return _channel
|
||||
.invokeMethod('checkFriend', _buildParam({'uidList': uidList}))
|
||||
.then((value) => _toList(value));
|
||||
}
|
||||
|
||||
/// dissolve friendship from friend list
|
||||
///
|
||||
Future<dynamic> deleteFromFriendList({required String uid}) {
|
||||
return _channel.invokeMethod(
|
||||
'deleteFromFriendList', _buildParam({"uid": uid}));
|
||||
}
|
||||
|
||||
/// accept application of be friend
|
||||
///
|
||||
Future<dynamic> acceptFriendApplication({required String uid}) {
|
||||
return _channel.invokeMethod(
|
||||
'acceptFriendApplication', _buildParam({"uid": uid}));
|
||||
}
|
||||
|
||||
/// refuse application of be friend
|
||||
///
|
||||
Future<dynamic> refuseFriendApplication({required String uid}) {
|
||||
return _channel.invokeMethod(
|
||||
'refuseFriendApplication', _buildParam({"uid": uid}));
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
Future<dynamic> forceSyncFriendApplication() {
|
||||
return _channel.invokeMethod('forceSyncFriendApplication', _buildParam({}));
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
Future<dynamic> forceSyncFriend() {
|
||||
return _channel.invokeMethod('forceSyncFriend', _buildParam({}));
|
||||
}
|
||||
|
||||
///
|
||||
Future<dynamic> forceSyncBlackList() {
|
||||
return _channel.invokeMethod('forceSyncBlackList', _buildParam({}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user