@@ -0,0 +1,144 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<configuration> | |||||
<configSections> | |||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |||||
</configSections> | |||||
<appSettings> | |||||
<!-- ================== 6:即时通信参数 ================== --> | |||||
<add key="IMUrl" value="http://localhost:8012" /> | |||||
</appSettings> | |||||
<!--日志--> | |||||
<log4net> | |||||
<!--根配置--> | |||||
<root> | |||||
<!--日志级别:可选值: ERROR > WARN > INFO > DEBUG --> | |||||
<level value="ERROR" /> | |||||
<level value="WARN" /> | |||||
<level value="INFO" /> | |||||
<level value="DEBUG" /> | |||||
<appender-ref ref="ErrorLog" /> | |||||
<appender-ref ref="WarnLog" /> | |||||
<appender-ref ref="InfoLog" /> | |||||
<appender-ref ref="DebugLog" /> | |||||
</root> | |||||
<!-- 错误 Error.log--> | |||||
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender"> | |||||
<!--目录路径,可以是相对路径或绝对路径--> | |||||
<param name="File" value="C:\Learun_log" /> | |||||
<!--文件名,按日期生成文件夹--> | |||||
<param name="DatePattern" value="/yyyy-MM-dd/"Error.log"" /> | |||||
<!--追加到文件--> | |||||
<appendToFile value="true" /> | |||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||||
<rollingStyle value="Composite" /> | |||||
<!--写到一个文件--> | |||||
<staticLogFileName value="false" /> | |||||
<!--单个文件大小。单位:KB|MB|GB--> | |||||
<maximumFileSize value="200MB" /> | |||||
<!--最多保留的文件数,设为"-1"则不限--> | |||||
<maxSizeRollBackups value="-1" /> | |||||
<!--日志格式--> | |||||
<layout type="log4net.Layout.PatternLayout"> | |||||
<conversionPattern value="%message" /> | |||||
</layout> | |||||
<filter type="log4net.Filter.LevelRangeFilter"> | |||||
<param name="LevelMin" value="ERROR" /> | |||||
<param name="LevelMax" value="ERROR" /> | |||||
</filter> | |||||
</appender> | |||||
<!-- 警告 Warn.log--> | |||||
<appender name="WarnLog" type="log4net.Appender.RollingFileAppender"> | |||||
<!--目录路径,可以是相对路径或绝对路径--> | |||||
<param name="File" value="C:\Learun_log" /> | |||||
<!--文件名,按日期生成文件夹--> | |||||
<param name="DatePattern" value="/yyyy-MM-dd/"Warn.log"" /> | |||||
<!--追加到文件--> | |||||
<appendToFile value="true" /> | |||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||||
<rollingStyle value="Composite" /> | |||||
<!--写到一个文件--> | |||||
<staticLogFileName value="false" /> | |||||
<!--单个文件大小。单位:KB|MB|GB--> | |||||
<maximumFileSize value="200MB" /> | |||||
<!--最多保留的文件数,设为"-1"则不限--> | |||||
<maxSizeRollBackups value="-1" /> | |||||
<!--日志格式--> | |||||
<layout type="log4net.Layout.PatternLayout"> | |||||
<conversionPattern value="%message" /> | |||||
</layout> | |||||
<filter type="log4net.Filter.LevelRangeFilter"> | |||||
<param name="LevelMin" value="WARN" /> | |||||
<param name="LevelMax" value="WARN" /> | |||||
</filter> | |||||
</appender> | |||||
<!-- 信息 Info.log--> | |||||
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender"> | |||||
<!--目录路径,可以是相对路径或绝对路径--> | |||||
<param name="File" value="C:\Learun_log" /> | |||||
<!--文件名,按日期生成文件夹--> | |||||
<param name="DatePattern" value="/yyyy-MM-dd/"Info.log"" /> | |||||
<!--追加到文件--> | |||||
<appendToFile value="true" /> | |||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||||
<rollingStyle value="Composite" /> | |||||
<!--写到一个文件--> | |||||
<staticLogFileName value="false" /> | |||||
<!--单个文件大小。单位:KB|MB|GB--> | |||||
<maximumFileSize value="200MB" /> | |||||
<!--最多保留的文件数,设为"-1"则不限--> | |||||
<maxSizeRollBackups value="-1" /> | |||||
<!--日志格式--> | |||||
<layout type="log4net.Layout.PatternLayout"> | |||||
<conversionPattern value="%message" /> | |||||
</layout> | |||||
<filter type="log4net.Filter.LevelRangeFilter"> | |||||
<param name="LevelMin" value="INFO" /> | |||||
<param name="LevelMax" value="INFO" /> | |||||
</filter> | |||||
</appender> | |||||
<!-- 调试 Debug.log--> | |||||
<appender name="DebugLog" type="log4net.Appender.RollingFileAppender"> | |||||
<!--目录路径,可以是相对路径或绝对路径--> | |||||
<param name="File" value="C:\Learun_log" /> | |||||
<!--文件名,按日期生成文件夹--> | |||||
<param name="DatePattern" value="/yyyy-MM-dd/"Debug.log"" /> | |||||
<!--追加到文件--> | |||||
<appendToFile value="true" /> | |||||
<!--创建日志文件的方式,可选值:Date[日期],文件大小[Size],混合[Composite]--> | |||||
<rollingStyle value="Composite" /> | |||||
<!--写到一个文件--> | |||||
<staticLogFileName value="false" /> | |||||
<!--单个文件大小。单位:KB|MB|GB--> | |||||
<maximumFileSize value="200MB" /> | |||||
<!--最多保留的文件数,设为"-1"则不限--> | |||||
<maxSizeRollBackups value="-1" /> | |||||
<!--日志格式--> | |||||
<layout type="log4net.Layout.PatternLayout"> | |||||
<conversionPattern value="%message" /> | |||||
</layout> | |||||
<filter type="log4net.Filter.LevelRangeFilter"> | |||||
<param name="LevelMin" value="DEBUG" /> | |||||
<param name="LevelMax" value="DEBUG" /> | |||||
</filter> | |||||
</appender> | |||||
</log4net> | |||||
<startup> | |||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | |||||
</startup> | |||||
<runtime> | |||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||||
<dependentAssembly> | |||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> | |||||
</dependentAssembly> | |||||
<dependentAssembly> | |||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" /> | |||||
</dependentAssembly> | |||||
</assemblyBinding> | |||||
</runtime> | |||||
</configuration> |
@@ -0,0 +1,120 @@ | |||||
using Microsoft.AspNet.SignalR; | |||||
using Microsoft.AspNet.SignalR.Hubs; | |||||
using System; | |||||
using System.Threading.Tasks; | |||||
namespace Quanjiang.DigitalSchool.IMServerService | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 | |||||
/// Copyright (c) 2013-2018 北京泉江科技有限公司 | |||||
/// 创建人:陈彬彬 | |||||
/// 日 期:2017.04.01 | |||||
/// 描 述:即使通信服务(可供客户端调用的方法开头用小写) | |||||
/// </summary> | |||||
[HubName("ChatsHub")] | |||||
public class Chats : Hub | |||||
{ | |||||
#region 重载Hub方法 | |||||
/// <summary> | |||||
/// 建立连接 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public override Task OnConnected() | |||||
{ | |||||
AddOnline(); | |||||
return base.OnConnected(); | |||||
} | |||||
/// <summary> | |||||
/// 断开连接 | |||||
/// </summary> | |||||
/// <param name="stopCalled">是否是客户端主动断开:true是,false超时断开</param> | |||||
/// <returns></returns> | |||||
public override Task OnDisconnected(bool stopCalled) | |||||
{ | |||||
RemoveOnline(); | |||||
return base.OnDisconnected(stopCalled); | |||||
} | |||||
/// <summary> | |||||
/// 重新建立连接 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
public override Task OnReconnected() | |||||
{ | |||||
AddOnline(); | |||||
return base.OnReconnected(); | |||||
} | |||||
#endregion | |||||
#region 客户端操作 | |||||
/// <summary> | |||||
/// 添加在线用户 | |||||
/// </summary> | |||||
public void AddOnline() | |||||
{ | |||||
string clientId = Context.ConnectionId; | |||||
string userId = GetUserId(); | |||||
Groups.Add(clientId, userId); | |||||
} | |||||
/// <summary> | |||||
/// 移除在线用户 | |||||
/// </summary> | |||||
public void RemoveOnline() | |||||
{ | |||||
string clientId = Context.ConnectionId; | |||||
string userId = GetUserId(); | |||||
Groups.Remove(clientId, userId); | |||||
} | |||||
/// <summary> | |||||
/// 发送消息 | |||||
/// </summary> | |||||
/// <param name="toUserId">对方UserId</param> | |||||
/// <param name="msg">消息</param> | |||||
/// <param name="isSystem">是否系统消息0不是1是</param> | |||||
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); | |||||
} | |||||
/// <summary> | |||||
/// 发送消息 | |||||
/// </summary> | |||||
/// <param name="myUserId">我的UserId</param> | |||||
/// <param name="toUserId">对方UserId</param> | |||||
/// <param name="msg">消息</param> | |||||
/// <param name="isSystem">是否系统消息0不是1是</param> | |||||
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 一般公用方法 | |||||
/// <summary> | |||||
/// 获取登录用户Id | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
private string GetUserId() | |||||
{ | |||||
string userId = ""; | |||||
if (Context.QueryString["userId"] != null) | |||||
{ | |||||
userId = Context.QueryString["userId"]; | |||||
} | |||||
return userId; | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -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 | |||||
{ | |||||
/// <summary> | |||||
/// 应用程序的主入口点。 | |||||
/// </summary> | |||||
static void Main() | |||||
{ | |||||
ServiceBase[] ServicesToRun; | |||||
ServicesToRun = new ServiceBase[] | |||||
{ | |||||
new QuanjiangDigitalSchollIMService() | |||||
}; | |||||
ServiceBase.Run(ServicesToRun); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,60 @@ | |||||
namespace Quanjiang.DigitalSchool.IMServerService | |||||
{ | |||||
partial class ProjectInstaller | |||||
{ | |||||
/// <summary> | |||||
/// 必需的设计器变量。 | |||||
/// </summary> | |||||
private System.ComponentModel.IContainer components = null; | |||||
/// <summary> | |||||
/// 清理所有正在使用的资源。 | |||||
/// </summary> | |||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||||
protected override void Dispose(bool disposing) | |||||
{ | |||||
if (disposing && (components != null)) | |||||
{ | |||||
components.Dispose(); | |||||
} | |||||
base.Dispose(disposing); | |||||
} | |||||
#region 组件设计器生成的代码 | |||||
/// <summary> | |||||
/// 设计器支持所需的方法 - 不要修改 | |||||
/// 使用代码编辑器修改此方法的内容。 | |||||
/// </summary> | |||||
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; | |||||
} | |||||
} |
@@ -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(); | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,129 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<root> | |||||
<!-- | |||||
Microsoft ResX Schema | |||||
Version 2.0 | |||||
The primary goals of this format is to allow a simple XML format | |||||
that is mostly human readable. The generation and parsing of the | |||||
various data types are done through the TypeConverter classes | |||||
associated with the data types. | |||||
Example: | |||||
... ado.net/XML headers & schema ... | |||||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
<resheader name="version">2.0</resheader> | |||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
</data> | |||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
<comment>This is a comment</comment> | |||||
</data> | |||||
There are any number of "resheader" rows that contain simple | |||||
name/value pairs. | |||||
Each data row contains a name, and value. The row also contains a | |||||
type or mimetype. Type corresponds to a .NET class that support | |||||
text/value conversion through the TypeConverter architecture. | |||||
Classes that don't support this are serialized and stored with the | |||||
mimetype set. | |||||
The mimetype is used for serialized objects, and tells the | |||||
ResXResourceReader how to depersist the object. This is currently not | |||||
extensible. For a given mimetype the value must be set accordingly: | |||||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
that the ResXResourceWriter will generate, however the reader can | |||||
read any of the formats listed below. | |||||
mimetype: application/x-microsoft.net.object.binary.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.soap.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
value : The object must be serialized into a byte array | |||||
: using a System.ComponentModel.TypeConverter | |||||
: and then encoded with base64 encoding. | |||||
--> | |||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
<xsd:element name="root" msdata:IsDataSet="true"> | |||||
<xsd:complexType> | |||||
<xsd:choice maxOccurs="unbounded"> | |||||
<xsd:element name="metadata"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
<xsd:attribute name="type" type="xsd:string" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="assembly"> | |||||
<xsd:complexType> | |||||
<xsd:attribute name="alias" type="xsd:string" /> | |||||
<xsd:attribute name="name" type="xsd:string" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="data"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="resheader"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:choice> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:schema> | |||||
<resheader name="resmimetype"> | |||||
<value>text/microsoft-resx</value> | |||||
</resheader> | |||||
<resheader name="version"> | |||||
<value>2.0</value> | |||||
</resheader> | |||||
<resheader name="reader"> | |||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<resheader name="writer"> | |||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<metadata name="serviceProcessInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||||
<value>17, 17</value> | |||||
</metadata> | |||||
<metadata name="serviceInstaller1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> | |||||
<value>208, 17</value> | |||||
</metadata> | |||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>False</value> | |||||
</metadata> | |||||
</root> |
@@ -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")] |
@@ -0,0 +1,118 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||||
<PropertyGroup> | |||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||||
<ProjectGuid>{E05A2B9A-A939-450F-9A44-A8B3201D055A}</ProjectGuid> | |||||
<OutputType>WinExe</OutputType> | |||||
<RootNamespace>Quanjiang.DigitalSchool.IMServerService</RootNamespace> | |||||
<AssemblyName>Quanjiang.DigitalSchool.IMServerService</AssemblyName> | |||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |||||
<FileAlignment>512</FileAlignment> | |||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | |||||
<Deterministic>true</Deterministic> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||||
<PlatformTarget>AnyCPU</PlatformTarget> | |||||
<DebugSymbols>true</DebugSymbols> | |||||
<DebugType>full</DebugType> | |||||
<Optimize>false</Optimize> | |||||
<OutputPath>bin\Debug\</OutputPath> | |||||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||||
<ErrorReport>prompt</ErrorReport> | |||||
<WarningLevel>4</WarningLevel> | |||||
</PropertyGroup> | |||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||||
<PlatformTarget>AnyCPU</PlatformTarget> | |||||
<DebugType>pdbonly</DebugType> | |||||
<Optimize>true</Optimize> | |||||
<OutputPath>bin\Release\</OutputPath> | |||||
<DefineConstants>TRACE</DefineConstants> | |||||
<ErrorReport>prompt</ErrorReport> | |||||
<WarningLevel>4</WarningLevel> | |||||
</PropertyGroup> | |||||
<ItemGroup> | |||||
<Reference Include="Microsoft.AspNet.SignalR.Core"> | |||||
<HintPath>..\packages\Microsoft.AspNet.SignalR.Core.2.2.2\lib\net45\Microsoft.AspNet.SignalR.Core.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Microsoft.Owin.3.1.0\lib\net45\Microsoft.Owin.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin.Cors, Version=3.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Microsoft.Owin.Cors.3.1.0\lib\net45\Microsoft.Owin.Cors.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin.Diagnostics"> | |||||
<HintPath>..\packages\Microsoft.Owin.Diagnostics.2.1.0\lib\net40\Microsoft.Owin.Diagnostics.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin.Host.HttpListener"> | |||||
<HintPath>..\packages\Microsoft.Owin.Host.HttpListener.2.1.0\lib\net45\Microsoft.Owin.Host.HttpListener.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin.Hosting, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Microsoft.Owin.Hosting.2.1.0\lib\net45\Microsoft.Owin.Hosting.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Microsoft.Owin.Security"> | |||||
<HintPath>..\packages\Microsoft.Owin.Security.2.1.0\lib\net45\Microsoft.Owin.Security.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="System" /> | |||||
<Reference Include="System.Configuration.Install" /> | |||||
<Reference Include="System.Core" /> | |||||
<Reference Include="System.Management" /> | |||||
<Reference Include="System.Web.Cors, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | |||||
<HintPath>..\packages\Microsoft.AspNet.Cors.5.0.0\lib\net45\System.Web.Cors.dll</HintPath> | |||||
</Reference> | |||||
<Reference Include="System.Xml.Linq" /> | |||||
<Reference Include="System.Data.DataSetExtensions" /> | |||||
<Reference Include="Microsoft.CSharp" /> | |||||
<Reference Include="System.Data" /> | |||||
<Reference Include="System.Net.Http" /> | |||||
<Reference Include="System.ServiceProcess" /> | |||||
<Reference Include="System.Xml" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<Compile Include="Hubs\Chats.cs" /> | |||||
<Compile Include="ProjectInstaller.cs"> | |||||
<SubType>Component</SubType> | |||||
</Compile> | |||||
<Compile Include="ProjectInstaller.Designer.cs"> | |||||
<DependentUpon>ProjectInstaller.cs</DependentUpon> | |||||
</Compile> | |||||
<Compile Include="Service1.cs"> | |||||
<SubType>Component</SubType> | |||||
</Compile> | |||||
<Compile Include="Service1.Designer.cs"> | |||||
<DependentUpon>Service1.cs</DependentUpon> | |||||
</Compile> | |||||
<Compile Include="Program.cs" /> | |||||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||||
<Compile Include="Startup1.cs" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<None Include="App.config"> | |||||
<SubType>Designer</SubType> | |||||
</None> | |||||
<None Include="packages.config" /> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<EmbeddedResource Include="ProjectInstaller.resx"> | |||||
<DependentUpon>ProjectInstaller.cs</DependentUpon> | |||||
</EmbeddedResource> | |||||
<EmbeddedResource Include="Service1.resx"> | |||||
<DependentUpon>Service1.cs</DependentUpon> | |||||
</EmbeddedResource> | |||||
</ItemGroup> | |||||
<ItemGroup> | |||||
<ProjectReference Include="..\Learun.Framework.Module\Learun.Log\Learun.Loger.csproj"> | |||||
<Project>{d27e14dc-b68c-408d-a2e3-fdb38665ecbb}</Project> | |||||
<Name>Learun.Loger</Name> | |||||
</ProjectReference> | |||||
<ProjectReference Include="..\Learun.Framework.Module\Learun.Util\Learun.Util\Learun.Util.csproj"> | |||||
<Project>{CF8AE293-88AB-436C-9720-A8386BA5D7B7}</Project> | |||||
<Name>Learun.Util</Name> | |||||
</ProjectReference> | |||||
</ItemGroup> | |||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||||
</Project> |
@@ -0,0 +1,40 @@ | |||||
namespace Quanjiang.DigitalSchool.IMServerService | |||||
{ | |||||
partial class QuanjiangDigitalSchollIMService | |||||
{ | |||||
/// <summary> | |||||
/// 必需的设计器变量。 | |||||
/// </summary> | |||||
private System.ComponentModel.IContainer components = null; | |||||
/// <summary> | |||||
/// 清理所有正在使用的资源。 | |||||
/// </summary> | |||||
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param> | |||||
protected override void Dispose(bool disposing) | |||||
{ | |||||
if (disposing && (components != null)) | |||||
{ | |||||
components.Dispose(); | |||||
} | |||||
base.Dispose(disposing); | |||||
} | |||||
#region 组件设计器生成的代码 | |||||
/// <summary> | |||||
/// 设计器支持所需的方法 - 不要修改 | |||||
/// 使用代码编辑器修改此方法的内容。 | |||||
/// </summary> | |||||
private void InitializeComponent() | |||||
{ | |||||
// | |||||
// QuanjiangDigitalSchollIMService | |||||
// | |||||
this.ServiceName = "QuanjiangDigitalSchollIMService"; | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -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() | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,123 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<root> | |||||
<!-- | |||||
Microsoft ResX Schema | |||||
Version 2.0 | |||||
The primary goals of this format is to allow a simple XML format | |||||
that is mostly human readable. The generation and parsing of the | |||||
various data types are done through the TypeConverter classes | |||||
associated with the data types. | |||||
Example: | |||||
... ado.net/XML headers & schema ... | |||||
<resheader name="resmimetype">text/microsoft-resx</resheader> | |||||
<resheader name="version">2.0</resheader> | |||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||||
<value>[base64 mime encoded serialized .NET Framework object]</value> | |||||
</data> | |||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||||
<comment>This is a comment</comment> | |||||
</data> | |||||
There are any number of "resheader" rows that contain simple | |||||
name/value pairs. | |||||
Each data row contains a name, and value. The row also contains a | |||||
type or mimetype. Type corresponds to a .NET class that support | |||||
text/value conversion through the TypeConverter architecture. | |||||
Classes that don't support this are serialized and stored with the | |||||
mimetype set. | |||||
The mimetype is used for serialized objects, and tells the | |||||
ResXResourceReader how to depersist the object. This is currently not | |||||
extensible. For a given mimetype the value must be set accordingly: | |||||
Note - application/x-microsoft.net.object.binary.base64 is the format | |||||
that the ResXResourceWriter will generate, however the reader can | |||||
read any of the formats listed below. | |||||
mimetype: application/x-microsoft.net.object.binary.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.soap.base64 | |||||
value : The object must be serialized with | |||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||||
: and then encoded with base64 encoding. | |||||
mimetype: application/x-microsoft.net.object.bytearray.base64 | |||||
value : The object must be serialized into a byte array | |||||
: using a System.ComponentModel.TypeConverter | |||||
: and then encoded with base64 encoding. | |||||
--> | |||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||||
<xsd:element name="root" msdata:IsDataSet="true"> | |||||
<xsd:complexType> | |||||
<xsd:choice maxOccurs="unbounded"> | |||||
<xsd:element name="metadata"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" use="required" type="xsd:string" /> | |||||
<xsd:attribute name="type" type="xsd:string" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="assembly"> | |||||
<xsd:complexType> | |||||
<xsd:attribute name="alias" type="xsd:string" /> | |||||
<xsd:attribute name="name" type="xsd:string" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="data"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||||
<xsd:attribute ref="xml:space" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
<xsd:element name="resheader"> | |||||
<xsd:complexType> | |||||
<xsd:sequence> | |||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||||
</xsd:sequence> | |||||
<xsd:attribute name="name" type="xsd:string" use="required" /> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:choice> | |||||
</xsd:complexType> | |||||
</xsd:element> | |||||
</xsd:schema> | |||||
<resheader name="resmimetype"> | |||||
<value>text/microsoft-resx</value> | |||||
</resheader> | |||||
<resheader name="version"> | |||||
<value>2.0</value> | |||||
</resheader> | |||||
<resheader name="reader"> | |||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<resheader name="writer"> | |||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||||
</resheader> | |||||
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||||
<value>False</value> | |||||
</metadata> | |||||
</root> |
@@ -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 | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,9 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<packages> | |||||
<package id="Common.Logging" version="2.1.2" targetFramework="net461" /> | |||||
<package id="Microsoft.AspNet.Cors" version="5.0.0" targetFramework="net461" /> | |||||
<package id="Microsoft.Owin" version="3.1.0" targetFramework="net461" /> | |||||
<package id="Microsoft.Owin.Cors" version="3.1.0" targetFramework="net461" /> | |||||
<package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net461" /> | |||||
<package id="Owin" version="1.0" targetFramework="net461" /> | |||||
</packages> |
@@ -70,7 +70,7 @@ | |||||
<!-- 发出邮箱设置邮箱主机 --> | <!-- 发出邮箱设置邮箱主机 --> | ||||
<add key="MailHost" value="smtp.ym.163.com" /> | <add key="MailHost" value="smtp.ym.163.com" /> | ||||
<!-- ================== 6:即时通信参数 ================== --> | <!-- ================== 6:即时通信参数 ================== --> | ||||
<add key="IMUrl" value="http://*:8012" /> | |||||
<add key="IMUrl" value="http://localhost:8012" /> | |||||
</appSettings> | </appSettings> | ||||
<!--日志--> | <!--日志--> | ||||
<log4net> | <log4net> | ||||
@@ -91,6 +91,16 @@ namespace Learun.Application.IMServer | |||||
#endregion | #endregion | ||||
#region 推送消息 | |||||
public void PushMessage(string msg) | |||||
{ | |||||
Clients.All.broadcastMessage(msg); | |||||
} | |||||
#endregion | |||||
#region 一般公用方法 | #region 一般公用方法 | ||||
/// <summary> | /// <summary> | ||||
/// 获取登录用户Id | /// 获取登录用户Id | ||||
@@ -3834,6 +3834,7 @@ | |||||
<Content Include="Views\LR_Content\script\lr-form.js" /> | <Content Include="Views\LR_Content\script\lr-form.js" /> | ||||
<Content Include="Views\LR_Content\script\lr-iframe-index.js" /> | <Content Include="Views\LR_Content\script\lr-iframe-index.js" /> | ||||
<Content Include="Views\LR_Content\script\lr-bootstrap.js" /> | <Content Include="Views\LR_Content\script\lr-bootstrap.js" /> | ||||
<Content Include="Views\LR_Content\script\pushmessage.js" /> | |||||
<Content Include="Views\LR_Content\script\lr-im.js" /> | <Content Include="Views\LR_Content\script\lr-im.js" /> | ||||
<Content Include="Views\LR_Content\script\lr-language - 副本.js" /> | <Content Include="Views\LR_Content\script\lr-language - 副本.js" /> | ||||
<Content Include="Views\LR_Content\script\lr-language.js" /> | <Content Include="Views\LR_Content\script\lr-language.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); |
@@ -45,10 +45,10 @@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="lr-frame-main" id="lr_frame_main"> | <div class="lr-frame-main" id="lr_frame_main"> | ||||
<img src="~/Content/images/iframebg.png"/> | |||||
<img src="~/Content/images/iframebg.png" /> | |||||
</div> | </div> | ||||
<script src="~/Content/bootstrap/bootstrap.min.js"></script> | <script src="~/Content/bootstrap/bootstrap.min.js"></script> | ||||
<script src="~/Content/jquery/plugin/layer/layer.js"></script> | <script src="~/Content/jquery/plugin/layer/layer.js"></script> | ||||
<script src="~/Content/jquery/plugin/jquery.cookie.min.js"></script> | <script src="~/Content/jquery/plugin/jquery.cookie.min.js"></script> | ||||
@@ -75,12 +75,13 @@ | |||||
"/Views/LR_Content/plugin/tree/lr-tree.js", | "/Views/LR_Content/plugin/tree/lr-tree.js", | ||||
"/Views/LR_Content/plugin/select/lr-select.js", | "/Views/LR_Content/plugin/select/lr-select.js", | ||||
"/Views/LR_Content/plugin/workflow/lr-workflow-api.js", | "/Views/LR_Content/plugin/workflow/lr-workflow-api.js", | ||||
"/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", | "/Views/LR_Content/plugin/contextmenu/lr-contextmenu.js", | ||||
"/Views/LR_Content/script/lr-im.js", | "/Views/LR_Content/script/lr-im.js", | ||||
"/Views/LR_Content/script/pushmessage.js", | |||||
"/Views/LR_Content/script/lr-admin.js" | "/Views/LR_Content/script/lr-admin.js" | ||||
) | ) | ||||
</body> | </body> | ||||
@@ -196,6 +196,7 @@ | |||||
<Compile Include="Modules\DataSourceNoLoginApi.cs" /> | <Compile Include="Modules\DataSourceNoLoginApi.cs" /> | ||||
<Compile Include="Modules\AskApi.cs" /> | <Compile Include="Modules\AskApi.cs" /> | ||||
<Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" /> | <Compile Include="Modules\EducationalAdministration\LoginUserBindApi.cs" /> | ||||
<Compile Include="Modules\PushMessageApi.cs" /> | |||||
<Compile Include="Modules\EvalApi.cs" /> | <Compile Include="Modules\EvalApi.cs" /> | ||||
<Compile Include="Modules\EducationalAdministration\R_EnterBuildingApi.cs" /> | <Compile Include="Modules\EducationalAdministration\R_EnterBuildingApi.cs" /> | ||||
<Compile Include="Modules\EducationalAdministration\R_EnterSchoolApi.cs" /> | <Compile Include="Modules\EducationalAdministration\R_EnterSchoolApi.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 | |||||
{ | |||||
/// <summary> | |||||
/// 版 本 Learun-ADMS-Ultimate V7.0.0 力软敏捷开发框架 | |||||
/// Copyright (c) 2013-2018 上海力软信息技术有限公司 | |||||
/// 创 建:超级管理员 | |||||
/// 日 期:2019-08-19 17:50 | |||||
/// 描 述:教师注册 | |||||
/// </summary> | |||||
public class PushMessageApi : BaseNoLoginApi | |||||
{ | |||||
/// <summary> | |||||
/// 推送消息接口 | |||||
/// <summary> | |||||
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 私有类 | |||||
/// <summary> | |||||
/// 表单实体类 | |||||
/// <summary> | |||||
private class ReqFormEntity | |||||
{ | |||||
public string keyValue { get; set; } | |||||
public string strEntity { get; set; } | |||||
} | |||||
#endregion | |||||
} | |||||
} |
@@ -122,6 +122,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learun.Application.Language | |||||
EndProject | EndProject | ||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learun.Application.Website", "Learun.Application.Website\Learun.Application.Website.csproj", "{DBB22F9E-ED75-40EB-A091-717D42C65A9B}" | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Learun.Application.Website", "Learun.Application.Website\Learun.Application.Website.csproj", "{DBB22F9E-ED75-40EB-A091-717D42C65A9B}" | ||||
EndProject | EndProject | ||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Quanjiang.DigitalSchool.IMServerService", "IMServerService\Quanjiang.DigitalSchool.IMServerService.csproj", "{E05A2B9A-A939-450F-9A44-A8B3201D055A}" | |||||
EndProject | |||||
Global | Global | ||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
Debug|Android = Debug|Android | 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-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.ActiveCfg = Release|Any CPU | ||||
{DBB22F9E-ED75-40EB-A091-717D42C65A9B}.Release|Windows-x86.Build.0 = 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 | EndGlobalSection | ||||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
@@ -1596,9 +1634,10 @@ Global | |||||
{4D033392-BBB8-4B5F-9144-A42E7695847E} = {16DDB25D-3101-47A2-BDC8-161954FD77FA} | {4D033392-BBB8-4B5F-9144-A42E7695847E} = {16DDB25D-3101-47A2-BDC8-161954FD77FA} | ||||
{36083FBB-CE7F-4EE0-8459-C4B60A2DD070} = {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} | {DBB22F9E-ED75-40EB-A091-717D42C65A9B} = {29DFF52B-8455-4EA1-8798-3AEE210D9372} | ||||
{E05A2B9A-A939-450F-9A44-A8B3201D055A} = {ED258CD0-0A0C-490B-9D8F-B4CEC4467251} | |||||
EndGlobalSection | EndGlobalSection | ||||
GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 | |||||
SolutionGuid = {968C278F-4142-4DFF-96B0-B3D70A649451} | SolutionGuid = {968C278F-4142-4DFF-96B0-B3D70A649451} | ||||
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 | |||||
EndGlobalSection | EndGlobalSection | ||||
EndGlobal | EndGlobal |