-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增 中台即时通讯服务端模板 ZhonTai.Template.IMServer
- Loading branch information
Showing
15 changed files
with
206 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/template", | ||
"author": "xiao xue", | ||
"classifications": [ "ZhonTai", "IM", "MyIMServer", "IMServer" ], | ||
"name": "ZhonTai.Template MyIMServer", | ||
"identity": "MyIMServer", | ||
"shortName": "MyIMServer", | ||
"tags": { | ||
"language": "C#" , | ||
"type":"project" | ||
}, | ||
"sourceName": "MyIMServer", | ||
"preferNameDirectory": true, | ||
"symbols": { | ||
}, | ||
"sources": [ | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
templates/im/content/MyIMServer.Host/MyIMServer.Host.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
<PropertyGroup> | ||
<TargetFramework>net9.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<NoWarn>1701;1702;1591;8632;CS8002;NU1902;NU1903;NU1904;</NoWarn> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="FreeIM" Version="2.0.1" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Text; | ||
|
||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
// Add services to the container. | ||
|
||
var app = builder.Build(); | ||
var configuration = app.Configuration; | ||
|
||
// Configure the HTTP request pipeline. | ||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | ||
Console.OutputEncoding = Encoding.GetEncoding("GB2312"); | ||
Console.InputEncoding = Encoding.GetEncoding("GB2312"); | ||
|
||
app.UseFreeImServer(new ImServerOptions | ||
{ | ||
Redis = new FreeRedis.RedisClient(configuration["ImServerOptions:RedisClient"]), | ||
Servers = configuration["ImServerOptions:Servers"]?.Split(";"), | ||
Server = configuration["ImServerOptions:Server"], | ||
}); | ||
|
||
app.Run(); |
9 changes: 9 additions & 0 deletions
9
templates/im/content/MyIMServer.Host/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/launchsettings.json", | ||
"profiles": { | ||
"ImServer": { | ||
"commandName": "Project", | ||
"commandLineArgs": "--urls=http://*:6010" | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
templates/im/content/MyIMServer.Host/appsettings.Development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*", | ||
"ImServerOptions": { | ||
"RedisClient": "127.0.0.1:6379,password=,poolsize=10,defaultDatabase=6", | ||
"Servers": "127.0.0.1:6010", | ||
"Server": "127.0.0.1:6010" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.12.35514.174 d17.12 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyIMServer.Host", "MyIMServer.Host\MyIMServer.Host.csproj", "{F9009C41-125A-40F7-8740-BC72280D016E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F9009C41-125A-40F7-8740-BC72280D016E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F9009C41-125A-40F7-8740-BC72280D016E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F9009C41-125A-40F7-8740-BC72280D016E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F9009C41-125A-40F7-8740-BC72280D016E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
MyIMServer即时通讯服务端项目模板说明 | ||
|
||
********************************************************* | ||
|
||
### nuget下载地址 | ||
``` | ||
https://www.nuget.org/downloads | ||
``` | ||
> 将`nuget.exe`放到 `F:\zhontai\Admin.Core\templates` 目录下 | ||
### 查看模板列表 | ||
``` | ||
dotnet new list | ||
``` | ||
|
||
### 生成nuget包 | ||
在 `F:\zhontai\Admin.Core\templates` 目录下 cmd 执行以下命令生成nuget包 | ||
``` | ||
nuget pack F:\zhontai\Admin.Core\templates\im\templates.nuspec -NoDefaultExcludes | ||
``` | ||
### 安装模板 | ||
``` | ||
dotnet new install ZhonTai.Template.IMServer | ||
``` | ||
安装本地 | ||
``` | ||
dotnet new install F:\zhontai\Admin.Core\templates\ZhonTai.Template.IMServer.1.0.0.nupkg | ||
``` | ||
|
||
### 创建项目 | ||
``` | ||
dotnet new MyIMServer -n MyCompanyName.IMServer | ||
``` | ||
|
||
### 卸载模板 | ||
``` | ||
dotnet new uninstall ZhonTai.Template.IMServer | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 zhontai | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<id>ZhonTai.Template.IMServer</id> | ||
<version>1.0.0</version> | ||
<authors>xiao xue</authors> | ||
<owners>zhon tai</owners> | ||
<projectUrl>https://github.com/zhontai/Admin.Core</projectUrl> | ||
<repository type="repository url" url="https://github.com/zhontai/Admin.Core" /> | ||
<license type="expression">MIT</license> | ||
<!-- <license type="file">license\LICENSE</license> --> | ||
<releaseNotes></releaseNotes> | ||
<copyright>Copyright ©2020 zhontai</copyright> | ||
<description>中台即时通讯服务端模板</description> | ||
<tags>ZhonTai IM IMServer MyIMServer</tags> | ||
<icon>logo.png</icon> | ||
<packageTypes> | ||
<packageType name="Template" /> | ||
</packageTypes> | ||
</metadata> | ||
<files> | ||
$CommonFileElements$ | ||
<file | ||
src="content/**" | ||
exclude="**/node_modules/**;**/bin/**;**/obj/**;**/.vs/**;**/.vscode/**;**/ClientApp/dist/**;**/wwwroot/dist/**;content/Directory.Build.*" | ||
target="" /> | ||
<file src="logo.png" target="" /> | ||
</files> | ||
</package> |