/// <summary> /// 廣播發送訊息 /// </summary> /// <param name="members">廣播對象</param> /// <param name="circleKey">學習圈代碼</param> private void SendNotice(List <Infrastructure.BusinessObject.MemberCacheData> members, string circleKey) { noticeService = new NoticeService(); foreach (var member in members) { // signalr發送通知 var myConn = System.Web.HttpContext.Current.Cache.Get(member.Id.ToString()) as List <string>; if (myConn != null) { var data = noticeService.GetNoticeList(circleKey, member.Id, 1); objHub.Clients.Client(myConn.FirstOrDefault()).showNoticeList(data); objHub.Clients.Client(myConn.FirstOrDefault()).appendNotice(data); } } }
/// <summary> /// 廣播發送訊息 /// </summary> /// <param name="members">廣播對象</param> /// <param name="circleKey">學習圈代碼</param> private void SendNotice(List <Infrastructure.BusinessObject.MemberCacheData> members, string circleKey) { noticeService = new NoticeService(); objHub = GlobalHost.ConnectionManager.GetHubContext <SignalRHub.WiicoHub>(); foreach (var member in members) { // signalr發送通知 var myConn = System.Web.HttpContext.Current.Cache.Get(member.Id.ToString()) as List <string>; if (myConn != null) { var data = noticeService.GetNoticeList(circleKey, member.Id, 1); foreach (var connId in myConn) { objHub.Clients.Client(connId).showRecordList(data); objHub.Clients.Client(connId).appendNotice(data); } } } }
public object GetStoreNoticeList([FromBody] JObject requestParams) { string userCode = requestParams.Property("userCode", true); return(NoticeService.GetNoticeList(userCode)); }