using Learun.Util; using System; using System.Collections.Generic; namespace Learun.Application.IM { /// /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架 /// Copyright (c) 2013-2018 上海力软信息技术有限公司 /// 创建人:力软-框架开发组 /// 日 期:2017.04.17 /// 描 述:即时通讯消息内容 /// public class IMMsgBLL: IMMsgIBLL { private IMMsgService iMMsgService = new IMMsgService(); #region 获取数据 /// /// 获取列表数据(最近的10条聊天记录) /// /// public IEnumerable GetList(string sendUserId, string recvUserId) { try { return iMMsgService.GetList(sendUserId, recvUserId); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 获取列表数据(小于某个时间点的5条记录) /// /// 我的ID /// 对方的ID /// 时间 /// public IEnumerable GetListByTime(string myUserId, string otherUserId, DateTime time) { try { return iMMsgService.GetListByTime(myUserId, otherUserId, time); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } } /// /// 获取列表数据(大于某个时间的所有数据) /// /// 我的ID /// 对方的ID /// 时间 /// public IEnumerable GetListByTime2(string myUserId, string otherUserId, DateTime time) { try { return iMMsgService.GetListByTime2(myUserId, otherUserId, time); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowServiceException(ex); } } } /// /// 获取列表分页数据 /// /// 分页参数 /// /// /// /// public IEnumerable GetPageList(Pagination pagination, string sendUserId, string recvUserId, string keyword) { try { return iMMsgService.GetPageList(pagination, sendUserId, recvUserId, keyword); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } #endregion #region 提交数据 /// /// 删除实体数据 /// 主键 /// /// public void DeleteEntity(string keyValue) { try { iMMsgService.DeleteEntity(keyValue); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } /// /// 保存实体数据(新增) /// 实体 /// /// public void SaveEntity(IMMsgEntity entity) { try { iMMsgService.SaveEntity(entity); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } #endregion } }