diff --git a/Learun.Framework.Ultimate V7/IMServerService/App.config b/Learun.Framework.Ultimate V7/IMServerService/App.config new file mode 100644 index 000000000..f8bb737fa --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/App.config @@ -0,0 +1,144 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/IMServerService/Hubs/Chats.cs b/Learun.Framework.Ultimate V7/IMServerService/Hubs/Chats.cs new file mode 100644 index 000000000..04a99c350 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Hubs/Chats.cs @@ -0,0 +1,120 @@ +using Microsoft.AspNet.SignalR; +using Microsoft.AspNet.SignalR.Hubs; +using System; +using System.Threading.Tasks; + +namespace Quanjiang.DigitalSchool.IMServerService +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创建人:陈彬彬 + /// 日 期:2017.04.01 + /// 描 述:即使通信服务(可供客户端调用的方法开头用小写) + /// + [HubName("ChatsHub")] + public class Chats : Hub + { + #region 重载Hub方法 + /// + /// 建立连接 + /// + /// + public override Task OnConnected() + { + AddOnline(); + return base.OnConnected(); + } + /// + /// 断开连接 + /// + /// 是否是客户端主动断开:true是,false超时断开 + /// + public override Task OnDisconnected(bool stopCalled) + { + RemoveOnline(); + return base.OnDisconnected(stopCalled); + } + /// + /// 重新建立连接 + /// + /// + public override Task OnReconnected() + { + AddOnline(); + return base.OnReconnected(); + } + #endregion + + #region 客户端操作 + /// + /// 添加在线用户 + /// + public void AddOnline() + { + string clientId = Context.ConnectionId; + string userId = GetUserId(); + Groups.Add(clientId, userId); + } + /// + /// 移除在线用户 + /// + public void RemoveOnline() + { + string clientId = Context.ConnectionId; + string userId = GetUserId(); + + Groups.Remove(clientId, userId); + } + /// + /// 发送消息 + /// + /// 对方UserId + /// 消息 + /// 是否系统消息0不是1是 + public void SendMsg(string toUserId, string msg, int isSystem) + { + string userId = GetUserId(); + Clients.Group(toUserId).RevMsg(userId, msg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), isSystem); + } + /// + /// 发送消息 + /// + /// 我的UserId + /// 对方UserId + /// 消息 + /// 是否系统消息0不是1是 + public void SendMsg2(string myUserId, string toUserId, string msg, int isSystem) + { + Clients.Group(toUserId).RevMsg(myUserId, msg, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), isSystem); + } + + #endregion + + + #region 推送消息 + + public void PushMessage(string msg) + { + Clients.All.broadcastMessage(msg); + } + + #endregion + + #region 一般公用方法 + /// + /// 获取登录用户Id + /// + /// + private string GetUserId() + { + string userId = ""; + if (Context.QueryString["userId"] != null) + { + userId = Context.QueryString["userId"]; + } + return userId; + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/Program.cs b/Learun.Framework.Ultimate V7/IMServerService/Program.cs new file mode 100644 index 000000000..67b3b2e78 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Program.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; + +namespace Quanjiang.DigitalSchool.IMServerService +{ + static class Program + { + /// + /// 应用程序的主入口点。 + /// + static void Main() + { + ServiceBase[] ServicesToRun; + ServicesToRun = new ServiceBase[] + { + new QuanjiangDigitalSchollIMService() + }; + ServiceBase.Run(ServicesToRun); + } + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.Designer.cs b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.Designer.cs new file mode 100644 index 000000000..19defa754 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.Designer.cs @@ -0,0 +1,60 @@ +namespace Quanjiang.DigitalSchool.IMServerService +{ + partial class ProjectInstaller + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller(); + this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller(); + // + // serviceProcessInstaller1 + // + this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem; + this.serviceProcessInstaller1.Password = null; + this.serviceProcessInstaller1.Username = null; + // + // serviceInstaller1 + // + this.serviceInstaller1.Description = "数字化智慧校园IM服务"; + this.serviceInstaller1.DisplayName = "QuanjiangDigitalSchollIMService"; + this.serviceInstaller1.ServiceName = "QuanjiangDigitalSchollIMService"; + this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic; + // + // ProjectInstaller + // + this.Installers.AddRange(new System.Configuration.Install.Installer[] { + this.serviceProcessInstaller1, + this.serviceInstaller1}); + + } + + #endregion + + private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1; + private System.ServiceProcess.ServiceInstaller serviceInstaller1; + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.cs b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.cs new file mode 100644 index 000000000..91439af00 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Configuration.Install; +using System.Linq; +using System.Threading.Tasks; + +namespace Quanjiang.DigitalSchool.IMServerService +{ + [RunInstaller(true)] + public partial class ProjectInstaller : System.Configuration.Install.Installer + { + public ProjectInstaller() + { + InitializeComponent(); + } + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.resx b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.resx new file mode 100644 index 000000000..a07029fab --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 208, 17 + + + False + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/IMServerService/Properties/AssemblyInfo.cs b/Learun.Framework.Ultimate V7/IMServerService/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..f1223d26e --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("IMServerService")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IMServerService")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("e05a2b9a-a939-450f-9a44-a8b3201d055a")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Learun.Framework.Ultimate V7/IMServerService/Quanjiang.DigitalSchool.IMServerService.csproj b/Learun.Framework.Ultimate V7/IMServerService/Quanjiang.DigitalSchool.IMServerService.csproj new file mode 100644 index 000000000..4e1ee105f --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Quanjiang.DigitalSchool.IMServerService.csproj @@ -0,0 +1,118 @@ + + + + + Debug + AnyCPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A} + WinExe + Quanjiang.DigitalSchool.IMServerService + Quanjiang.DigitalSchool.IMServerService + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll + + + ..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll + + + ..\packages\Microsoft.Owin.Cors.3.1.0\lib\net45\Microsoft.Owin.Cors.dll + + + ..\packages\Microsoft.Owin.Diagnostics.2.1.0\lib\net40\Microsoft.Owin.Diagnostics.dll + + + ..\packages\Microsoft.Owin.Host.HttpListener.2.1.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll + + + ..\packages\Microsoft.Owin.Hosting.2.1.0\lib\net45\Microsoft.Owin.Hosting.dll + + + ..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll + + + ..\packages\Owin.1.0\lib\net40\Owin.dll + + + + + + + ..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll + + + + + + + + + + + + + Component + + + ProjectInstaller.cs + + + Component + + + Service1.cs + + + + + + + + Designer + + + + + + ProjectInstaller.cs + + + Service1.cs + + + + + {d27e14dc-b68c-408d-a2e3-fdb38665ecbb} + Learun.Loger + + + {CF8AE293-88AB-436C-9720-A8386BA5D7B7} + Learun.Util + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/IMServerService/Service1.Designer.cs b/Learun.Framework.Ultimate V7/IMServerService/Service1.Designer.cs new file mode 100644 index 000000000..6c780fe2a --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Service1.Designer.cs @@ -0,0 +1,40 @@ +namespace Quanjiang.DigitalSchool.IMServerService +{ + partial class QuanjiangDigitalSchollIMService + { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region 组件设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要修改 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() + { + // + // QuanjiangDigitalSchollIMService + // + this.ServiceName = "QuanjiangDigitalSchollIMService"; + + } + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/Service1.cs b/Learun.Framework.Ultimate V7/IMServerService/Service1.cs new file mode 100644 index 000000000..b7d3c49f0 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Service1.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Linq; +using System.Reflection; +using System.ServiceProcess; +using System.Text; +using System.Threading.Tasks; +using Learun.Loger; +using Learun.Util; +using Microsoft.AspNet.SignalR; +using Microsoft.Owin; +using Microsoft.Owin.Cors; +using Microsoft.Owin.Hosting; +using Owin; + +[assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))] +namespace Quanjiang.DigitalSchool.IMServerService +{ + public partial class QuanjiangDigitalSchollIMService : ServiceBase + { + private Log log = LogFactory.GetLogger("QuanjiangDigitalSchollIMService"); + public QuanjiangDigitalSchollIMService() + { + InitializeComponent(); + } + + protected override void OnStart(string[] args) + { + string SignalRURI = Config.GetValue("IMUrl"); + try + { + WebApp.Start(SignalRURI); + log.Info(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务已启动" }); + } + catch (Exception e) + { + log.Error(new { Browser = "QuanjiangDigitalSchollIMService", Content = "服务启动异常" + e.Message+e.StackTrace }); + } + } + + protected override void OnStop() + { + } + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/Service1.resx b/Learun.Framework.Ultimate V7/IMServerService/Service1.resx new file mode 100644 index 000000000..e5858cc29 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Service1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/IMServerService/Startup1.cs b/Learun.Framework.Ultimate V7/IMServerService/Startup1.cs new file mode 100644 index 000000000..0e16103a5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/Startup1.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNet.SignalR; +using Microsoft.Owin; +using Microsoft.Owin.Cors; +using Owin; + +[assembly: OwinStartup(typeof(Quanjiang.DigitalSchool.IMServerService.Startup1))] + +namespace Quanjiang.DigitalSchool.IMServerService +{ + public class Startup1 + { + public void Configuration(IAppBuilder app) + { + app.Map("/signalr", map => + { + map.UseCors(CorsOptions.AllowAll); + var hubConfiguration = new HubConfiguration + { + // You can enable JSONP by uncommenting line below. + // JSONP requests are insecure but some older browsers (and some + // versions of IE) require JSONP to work cross domain + EnableJSONP = true + }; + // Run the SignalR pipeline. We're not using MapSignalR + // since this branch is already runs under the "/signalr" + // path. + map.RunSignalR(hubConfiguration); + }); + app.MapSignalR(); + // 有关如何配置应用程序的详细信息,请访问 https://go.microsoft.com/fwlink/?LinkID=316888 + } + } +} diff --git a/Learun.Framework.Ultimate V7/IMServerService/packages.config b/Learun.Framework.Ultimate V7/IMServerService/packages.config new file mode 100644 index 000000000..e217cbe40 --- /dev/null +++ b/Learun.Framework.Ultimate V7/IMServerService/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.IMServer/App.config b/Learun.Framework.Ultimate V7/Learun.Application.IMServer/App.config index e07370b1f..1392c4b86 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.IMServer/App.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.IMServer/App.config @@ -70,7 +70,7 @@ - + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.IMServer/Hubs/Chats.cs b/Learun.Framework.Ultimate V7/Learun.Application.IMServer/Hubs/Chats.cs index 99c57d6b7..96f615fe0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.IMServer/Hubs/Chats.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.IMServer/Hubs/Chats.cs @@ -91,6 +91,16 @@ namespace Learun.Application.IMServer #endregion + + #region 推送消息 + + public void PushMessage(string msg) + { + Clients.All.broadcastMessage(msg); + } + + #endregion + #region 一般公用方法 /// /// 获取登录用户Id diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index d3acbb7a4..f28456852 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -3834,6 +3834,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/pushmessage.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/pushmessage.js new file mode 100644 index 000000000..33471a823 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/LR_Content/script/pushmessage.js @@ -0,0 +1,75 @@ +(function ($, learun) { + "use strict"; + + + learun._im = { + init: function () { + learun._im.registerServer(); + learun._im.connect(); + } + // 连接服务端 + , connect: function () { + var loginInfo = learun.clientdata.get(['userinfo']); + if (loginInfo.imOpen != 'true') { + setTimeout(learun._im.connect, 1000); + } + + $.ajax({ + url: loginInfo.imUrl + "/hubs", + type: "get", + dataType: "text", + success: function (data) { + eval(data); + //Set the hubs URL for the connection + $.connection.hub.url = loginInfo.imUrl; + $.connection.hub.qs = { "userId": loginInfo.userId }; + // Declare a proxy to reference the hub. + learun.imChat = $.connection.ChatsHub; + learun.imChat.client.broadcastMessage = function(message) { + top.layer.open({ + type: 1 //此处以iframe举例 + , title: '通知' + , area: ['390px', '330px'] + , shade: 0 + , offset: 'rb' + , maxmin: true + , content: message + , btn: null + , yes: function () { + $(that).click(); //此处只是为了演示,实际使用可以剔除 + } + , btn2: function () { + layer.closeAll(); + } + + , zIndex: layer.zIndex //重点1 + , success: function (layero) { + layer.setTop(layero); //重点2 + } + }); + } + if (!learun.imChat) { + setTimeout(learun._im.connect, 1000); + } + // 连接成功后注册服务器方法 + $.connection.hub.start().done(function () { + learun.imChat.server.pushMessage('123123'); + }); + //断开连接后 + $.connection.hub.disconnected(function () { + // + }); + }, + error: function (XMLHttpRequest, textStatus, errorThrown) { + isLoaded = 0; + }, + }); + } + }; + + + $(function() { + learun._im.connect(); + }) + +})(jQuery, top.learun); \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Shared/_Admin.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Shared/_Admin.cshtml index 6b75f3534..a5f58eda7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Shared/_Admin.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/Shared/_Admin.cshtml @@ -45,10 +45,10 @@
- +
- + @@ -75,12 +75,13 @@ "/Views/LR_Content/plugin/tree/lr-tree.js", "/Views/LR_Content/plugin/select/lr-select.js", - + "/Views/LR_Content/plugin/workflow/lr-workflow-api.js", "/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", "/Views/LR_Content/script/lr-im.js", - + "/Views/LR_Content/script/pushmessage.js", + "/Views/LR_Content/script/lr-admin.js" ) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index c567566d8..1a2d19159 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -196,6 +196,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PushMessageApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PushMessageApi.cs new file mode 100644 index 000000000..540b23bfb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/PushMessageApi.cs @@ -0,0 +1,61 @@ +using Nancy; +using Learun.Util; +using System.Collections.Generic; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using static Learun.Application.WebApi.Modules.StuInfoFreshApi; +using System; +using System.IO; +using Learun.Application.Base.SystemModule; + +namespace Learun.Application.WebApi +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架 + /// Copyright (c) 2013-2018 上海力软信息技术有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-08-19 17:50 + /// 描 述:教师注册 + /// + + public class PushMessageApi : BaseNoLoginApi + { + + /// + /// 推送消息接口 + /// + public PushMessageApi() + : base("/Learun/adms/pushMessage") + { + Get["/msg"] = PushMessage; + } + + private Response PushMessage(dynamic _) + { + string msg = this.Request.Query["msg"].ToString(); + + if (!string.IsNullOrEmpty(msg)) + { + SendHubs.callMethod("pushMessage", msg); + } + return Success("成功"); + } + + #region 获取数据 + + + #endregion + + #region 私有类 + + /// + /// 表单实体类 + /// + private class ReqFormEntity + { + public string keyValue { get; set; } + public string strEntity { get; set; } + } + #endregion + + } +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln b/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln index ad2f31050..b2f47cb27 100644 --- a/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln +++ b/Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln @@ -122,6 +122,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learun.Application.Language EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learun.Application.Website", "Learun.Application.Website\Learun.Application.Website.csproj", "{DBB22F9E-ED75-40EB-A091-717D42C65A9B}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quanjiang.DigitalSchool.IMServerService", "IMServerService\Quanjiang.DigitalSchool.IMServerService.csproj", "{E05A2B9A-A939-450F-9A44-A8B3201D055A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Android = Debug|Android @@ -1548,6 +1550,42 @@ Global {DBB22F9E-ED75-40EB-A091-717D42C65A9B}.Release|Windows-x64.Build.0 = Release|Any CPU {DBB22F9E-ED75-40EB-A091-717D42C65A9B}.Release|Windows-x86.ActiveCfg = Release|Any CPU {DBB22F9E-ED75-40EB-A091-717D42C65A9B}.Release|Windows-x86.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Android.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Android.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|iOS.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|iOS.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-ARM.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-ARM.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-x64.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-x64.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-x86.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Debug|Windows-x86.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Android.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Android.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Any CPU.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Any CPU.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|iOS.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|iOS.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-ARM.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-ARM.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-x64.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-x64.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-x86.ActiveCfg = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Development|Windows-x86.Build.0 = Debug|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Android.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Android.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Any CPU.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|iOS.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|iOS.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-ARM.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-ARM.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-x64.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-x64.Build.0 = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-x86.ActiveCfg = Release|Any CPU + {E05A2B9A-A939-450F-9A44-A8B3201D055A}.Release|Windows-x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1596,9 +1634,10 @@ Global {4D033392-BBB8-4B5F-9144-A42E7695847E} = {16DDB25D-3101-47A2-BDC8-161954FD77FA} {36083FBB-CE7F-4EE0-8459-C4B60A2DD070} = {16DDB25D-3101-47A2-BDC8-161954FD77FA} {DBB22F9E-ED75-40EB-A091-717D42C65A9B} = {29DFF52B-8455-4EA1-8798-3AEE210D9372} + {E05A2B9A-A939-450F-9A44-A8B3201D055A} = {ED258CD0-0A0C-490B-9D8F-B4CEC4467251} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 SolutionGuid = {968C278F-4142-4DFF-96B0-B3D70A649451} + EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 EndGlobalSection EndGlobal