using Learun.Util; using System; using System.Collections.Generic; namespace Learun.Application.IM { /// /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架 /// Copyright (c) 2013-2018 Hexagon PPM /// 创建人:研发部 /// 日 期: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, string Isread , string ProjectId) { try { return iMMsgService.GetPageList(pagination, sendUserId, recvUserId, keyword, Isread, ProjectId); } catch (Exception ex) { if (ex is ExceptionEx) { throw; } else { throw ExceptionEx.ThrowBusinessException(ex); } } } public object GetMsgNotReadNum(string userId,string ProjectId) { try { return iMMsgService.GetMsgNotReadNum(userId, ProjectId); } 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); } } } public int UpdateIsread(string msgId, string isRead) { return iMMsgService.UpdateIsread(msgId,isRead); } public IEnumerable GetProjectMsg(string ProjectId, string userId) { return iMMsgService.GetProjectMsg(ProjectId, userId); } #endregion } }