im即时通讯软件app源码-仿微信-开发日记
/// 添加群成员
Future<bool> addGroupMemberById(String id, List list) async {
try {
Map data = {"id": id, "clientList": list};
var resData = await HttpUtils.request('/oauth/netty-room/invite-to-room', desc: '添加群成员', method: HttpUtils.POST, isAuth: true, data: data);
return resData > 0;
} on ApiResponseEntity catch (e) {
ToastUtils.showHint(HttpErrorCode.getErrorMessage(e.code.toString()));
LoggerService.to.logger.e(HttpErrorCode.getErrorMessage(e.code.toString()), 'http-error');
return false;
} catch (e) {
LoggerService.to.logger.e(e, 'system');
return false;
}
}
/// 管理员撤回群消息
Future<bool> delGroupChatMessage(String id, String roomId) async {
try {
var resData = await HttpUtils.request(
'/oauth/netty-msg/room/$roomId/delete/$id',
desc: '管理员撤回群消息',
method: HttpUtils.PATCH,
isAuth: true,
);
return resData > 0;
} on ApiResponseEntity catch (e) {
ToastUtils.showHint(HttpErrorCode.getErrorMessage(e.code.toString()));
LoggerService.to.logger.e(HttpErrorCode.getErrorMessage(e.code.toString()), 'http-error');
return false;
} catch (e) {
LoggerService.to.logger.e(e, 'system');
return false;
}
}