Explorar el Código

im服务制作

西昌缴费二期
liangkun hace 4 años
padre
commit
4e5cf30387
Se han modificado 14 ficheros con 946 adiciones y 1 borrados
  1. +144
    -0
      Learun.Framework.Ultimate V7/IMServerService/App.config
  2. +120
    -0
      Learun.Framework.Ultimate V7/IMServerService/Hubs/Chats.cs
  3. +25
    -0
      Learun.Framework.Ultimate V7/IMServerService/Program.cs
  4. +60
    -0
      Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.Designer.cs
  5. +19
    -0
      Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.cs
  6. +129
    -0
      Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.resx
  7. +36
    -0
      Learun.Framework.Ultimate V7/IMServerService/Properties/AssemblyInfo.cs
  8. +118
    -0
      Learun.Framework.Ultimate V7/IMServerService/Quanjiang.DigitalSchool.IMServerService.csproj
  9. +40
    -0
      Learun.Framework.Ultimate V7/IMServerService/Service1.Designer.cs
  10. +48
    -0
      Learun.Framework.Ultimate V7/IMServerService/Service1.cs
  11. +123
    -0
      Learun.Framework.Ultimate V7/IMServerService/Service1.resx
  12. +35
    -0
      Learun.Framework.Ultimate V7/IMServerService/Startup1.cs
  13. +9
    -0
      Learun.Framework.Ultimate V7/IMServerService/packages.config
  14. +40
    -1
      Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln

+ 144
- 0
Learun.Framework.Ultimate V7/IMServerService/App.config Ver fichero

@@ -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/&quot;Error.log&quot;" />
<!--追加到文件-->
<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/&quot;Warn.log&quot;" />
<!--追加到文件-->
<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/&quot;Info.log&quot;" />
<!--追加到文件-->
<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/&quot;Debug.log&quot;" />
<!--追加到文件-->
<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>

+ 120
- 0
Learun.Framework.Ultimate V7/IMServerService/Hubs/Chats.cs Ver fichero

@@ -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
}
}

+ 25
- 0
Learun.Framework.Ultimate V7/IMServerService/Program.cs Ver fichero

@@ -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);
}
}
}

+ 60
- 0
Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.Designer.cs Ver fichero

@@ -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;
}
}

+ 19
- 0
Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.cs Ver fichero

@@ -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();
}
}
}

+ 129
- 0
Learun.Framework.Ultimate V7/IMServerService/ProjectInstaller.resx Ver fichero

@@ -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>

+ 36
- 0
Learun.Framework.Ultimate V7/IMServerService/Properties/AssemblyInfo.cs Ver fichero

@@ -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")]

+ 118
- 0
Learun.Framework.Ultimate V7/IMServerService/Quanjiang.DigitalSchool.IMServerService.csproj Ver fichero

@@ -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>

+ 40
- 0
Learun.Framework.Ultimate V7/IMServerService/Service1.Designer.cs Ver fichero

@@ -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
}
}

+ 48
- 0
Learun.Framework.Ultimate V7/IMServerService/Service1.cs Ver fichero

@@ -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()
{
}
}
}

+ 123
- 0
Learun.Framework.Ultimate V7/IMServerService/Service1.resx Ver fichero

@@ -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>

+ 35
- 0
Learun.Framework.Ultimate V7/IMServerService/Startup1.cs Ver fichero

@@ -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
}
}
}

+ 9
- 0
Learun.Framework.Ultimate V7/IMServerService/packages.config Ver fichero

@@ -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>

+ 40
- 1
Learun.Framework.Ultimate V7/西昌单校区版V3.0.sln Ver fichero

@@ -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

Cargando…
Cancelar
Guardar