baseline: 小军 WMS 二开代码原始快照(含 SynOABusiness.cs Debugger.Break)
This commit is contained in:
commit
c2b0e7be0d
6522 files changed
+3530643
No files matched your search
Vendored
BIN
Binary file not shown.
Executable
+30
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:63080",
|
||||
"sslPort": 0
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"Test": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "weatherforecast",
|
||||
"applicationUrl": "http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Opsoft.NetCore.O3App
|
||||
{
|
||||
public static class TestServiceRegister
|
||||
{
|
||||
public static void RegisteServices(WebHostBuilderContext builderContext, IServiceCollection services)
|
||||
{
|
||||
var @namespace = typeof(TestServiceRegister).Namespace;
|
||||
var rootPath = Path.GetDirectoryName(typeof(TestServiceRegister).Assembly.Location);
|
||||
var rootDir = new DirectoryInfo(rootPath);
|
||||
var dllFiles = rootDir.EnumerateFiles("*.dll", SearchOption.TopDirectoryOnly);
|
||||
Console.WriteLine($"Finded DllFiles: \n\t{string.Join("\n\t", dllFiles)}");
|
||||
var localAssemblies = (from file in dllFiles where file.Name.StartsWith(@namespace) || file.Name.StartsWith("O3App", StringComparison.CurrentCultureIgnoreCase) select Assembly.LoadFrom(file.FullName));
|
||||
foreach (var assembly in localAssemblies)
|
||||
{
|
||||
services.AddEnumerable(builderContext, assembly);
|
||||
}
|
||||
services.AddSingleton<IConfigurationProvider>(new MapperConfiguration(cfg => cfg.AddMaps(localAssemblies)));
|
||||
services.AddSingleton<IMapper>(sp => new Mapper(sp.GetRequiredService<IConfigurationProvider>(), sp.GetService));
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AssemblyName>Opsoft.NetCore.O3App.Test</AssemblyName>
|
||||
<RootNamespace>Opsoft.NetCore.O3App.Test</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AutoMapper" Version="10.1.1" />
|
||||
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="Moq" Version="4.16.1" />
|
||||
<PackageReference Include="Opsoft.Data" Version="0.1.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Domain\Domain.csproj" />
|
||||
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
|
||||
<ProjectReference Include="..\Services\Services.csproj" />
|
||||
<ProjectReference Include="..\Shared\Shared.csproj" />
|
||||
<ProjectReference Include="..\WebApi\WebApi.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
</Project>
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Test
|
||||
{
|
||||
[Xunit.Collection("TestCollection")]
|
||||
public class TestBase
|
||||
{
|
||||
protected readonly IServiceProvider ServiceProvider;
|
||||
protected readonly IConfiguration Configuration;
|
||||
|
||||
public TestBase(TestStartupFixture fixture)
|
||||
{
|
||||
ServiceProvider = fixture.Services;
|
||||
|
||||
this.Configuration = ServiceProvider.GetService<IConfiguration>();
|
||||
}
|
||||
|
||||
protected virtual T GetConfigSection<T>(string key)
|
||||
{
|
||||
var targetSection = Configuration.GetSection(key);
|
||||
targetSection = targetSection ?? throw new ArgumentException($"Not Exists Config Key: {key}");
|
||||
return targetSection.Get<T>();
|
||||
}
|
||||
|
||||
protected virtual T GetService<T>()
|
||||
{
|
||||
return ServiceProvider.GetService<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Test
|
||||
{
|
||||
[Xunit.CollectionDefinition("TestCollection")]
|
||||
public class TestCollection : Xunit.ICollectionFixture<TestStartupFixture>
|
||||
{
|
||||
}
|
||||
}
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
|
||||
"InvoiceProductConfig": [
|
||||
{
|
||||
"ProductTypeIn": [ 2, 4, 5, 6, 7, 8, 10, 11, 12, 14, 19, 25, 100, 3001, 5001, 5003, 5005 ],
|
||||
"ProductTypeRange": {
|
||||
"Min": 0,
|
||||
"Max": 0
|
||||
},
|
||||
"IncludeSubTypes": [],
|
||||
"ExcludeSubTypes": [],
|
||||
"IsInvoice": 1,
|
||||
"IsDeduct": 1
|
||||
},
|
||||
{
|
||||
"ProductTypeIn": [],
|
||||
"ProductTypeRange": {
|
||||
"Min": 9000,
|
||||
"Max": 9999
|
||||
},
|
||||
"IncludeSubTypes": null,
|
||||
"ExcludeSubTypes": null,
|
||||
"IsInvoice": 1,
|
||||
"IsDeduct": 1
|
||||
},
|
||||
{
|
||||
"ProductTypeIn": [ 3 ],
|
||||
"ProductTypeRange": {
|
||||
"Min": 0,
|
||||
"Max": 0
|
||||
},
|
||||
"IncludeSubTypes": [ 7 ],
|
||||
"ExcludeSubTypes": null,
|
||||
"IsInvoice": 1,
|
||||
"IsDeduct": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
Executable
+42
@@ -0,0 +1,42 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Opsoft.NetCore.O3App.Infrastructure;
|
||||
using Opsoft.NetCore.O3App.Shared.Data;
|
||||
using System;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Test
|
||||
{
|
||||
public class TestStartup
|
||||
{
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
public TestStartup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
||||
}
|
||||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services
|
||||
.AddHttpClient()
|
||||
.AddOptions()
|
||||
//.AddGenericDSFClient()
|
||||
.AddCustomHttpClient()
|
||||
.AddSkynetLogger()
|
||||
.AddTraceId()
|
||||
//.AddRedisCache(builder =>
|
||||
//{
|
||||
// builder.UseStackExchange().AddEndpoint("Opsoft.NetCore.O3App", "192.168.0.147:10577");
|
||||
//})
|
||||
.AddDataSource(builder => builder.UseConfiguration(Configuration));
|
||||
|
||||
services.AddDataSource(builder => builder.UseConfiguration(Configuration));
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+141
@@ -0,0 +1,141 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Hosting.Server.Features;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Opsoft.NetCore.O3App.Infrastructure;
|
||||
using Opsoft.NetCore.O3App.Shared;
|
||||
using Serilog;
|
||||
using Serilog.Events;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Net.NetworkInformation;
|
||||
|
||||
namespace Opsoft.NetCore.O3App.Test
|
||||
{
|
||||
public class TestStartupFixture : IDisposable
|
||||
{
|
||||
private readonly IWebHost server;
|
||||
public IServiceProvider Services { get; }
|
||||
|
||||
public string ServiceBaseUrl { get; }
|
||||
|
||||
private System.Collections.Generic.Dictionary<string, string> defaultConfigs = new System.Collections.Generic.Dictionary<string, string>();
|
||||
|
||||
public TestStartupFixture()
|
||||
{
|
||||
SetDefaultConfigs();
|
||||
|
||||
var builder = WebHost.CreateDefaultBuilder()
|
||||
.UseUrls($"http://localhost:{GetRandomPort()}")
|
||||
.ConfigureAppConfiguration(ConfigureAppConfiguration)
|
||||
.ConfigureServices(ServiceRegister.RegisteServices)
|
||||
.UseSerilog(UseSkynetLogger)
|
||||
.UseKestrel()
|
||||
.UseStartup<TestStartup>();
|
||||
|
||||
server = builder.Build();
|
||||
server.Start();
|
||||
|
||||
var url = server.ServerFeatures.Get<IServerAddressesFeature>().Addresses.First();
|
||||
Services = server.Services;
|
||||
ServiceBaseUrl = $"{url}/api/";
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private void ConfigureAppConfiguration(WebHostBuilderContext context, IConfigurationBuilder builder)
|
||||
{
|
||||
builder.SetBasePath(System.IO.Directory.GetCurrentDirectory());
|
||||
builder
|
||||
.AddInMemoryCollection(defaultConfigs)
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsetting.json", optional: true, reloadOnChange: true);
|
||||
var testConfigFiles = System.IO.Directory.EnumerateFiles(".\\TestDatas", "*.json", System.IO.SearchOption.TopDirectoryOnly);
|
||||
if (testConfigFiles.NotNullOrEmpty())
|
||||
{
|
||||
foreach (var configFile in testConfigFiles)
|
||||
{
|
||||
builder.AddJsonFile(configFile, optional: false, reloadOnChange: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TestDataInitialize
|
||||
/// </summary>
|
||||
private void Initialize()
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
private void SetDefaultConfigs()
|
||||
{
|
||||
defaultConfigs.Add(nameof(LoggerFilters), LoggerFilters);
|
||||
|
||||
defaultConfigs.Add("DAOKEAPPUK", "opsoft.netcore.O3App");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
server.Dispose();
|
||||
}
|
||||
|
||||
private static readonly Random Random = new Random();
|
||||
|
||||
private static int GetRandomPort()
|
||||
{
|
||||
var activePorts = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpListeners().Select(_ => _.Port).ToList();
|
||||
|
||||
var randomPort = Random.Next(10000, 65535);
|
||||
|
||||
while (activePorts.Contains(randomPort))
|
||||
{
|
||||
randomPort = Random.Next(10000, 65535);
|
||||
}
|
||||
|
||||
return randomPort;
|
||||
}
|
||||
|
||||
|
||||
private static void UseSkynetLogger(WebHostBuilderContext context, LoggerConfiguration configuration)
|
||||
{
|
||||
string logPath = $"/data/logs/app.log";
|
||||
long? fileSizeLimitBytes = 10485760;
|
||||
bool buffered = false;
|
||||
bool shared = true;
|
||||
TimeSpan? flushToDiskInterval = null;
|
||||
bool rollOnFileSizeLimit = true;
|
||||
int? retainedFileCountLimit = 640;
|
||||
configuration.Filter.With(new SkynetLoggerFilter(context.Configuration));
|
||||
configuration.Enrich.With(new SkynetEnricher())
|
||||
.WriteTo.File(new SkynetLoggerFormatter(), logPath, LogEventLevel.Debug,
|
||||
fileSizeLimitBytes, null, buffered, shared,
|
||||
flushToDiskInterval, RollingInterval.Day, rollOnFileSizeLimit,
|
||||
retainedFileCountLimit);
|
||||
}
|
||||
|
||||
private static readonly string LoggerFilters = @"[
|
||||
{
|
||||
""Catogery"": ""System"",
|
||||
""MinLevel"": 5
|
||||
},
|
||||
{
|
||||
""Catogery"": ""Microsoft"",
|
||||
""MinLevel"": 5
|
||||
},
|
||||
{
|
||||
""Catogery"": ""Opsoft.Apm"",
|
||||
""MinLevel"": 5
|
||||
},
|
||||
{
|
||||
""Catogery"": ""Opsoft.NetCore.O3App.Services"",
|
||||
""MinLevel"": 1
|
||||
},
|
||||
{
|
||||
""Catogery"": ""Opsoft.NetCore.O3App.Test"",
|
||||
""MinLevel"": 4
|
||||
}
|
||||
]";
|
||||
|
||||
}
|
||||
}
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"LastVersion": {
|
||||
"version": "1.0.3",
|
||||
"downloadIOSUrl": "http://127.0.0.1/APPServer/wmsapp.1.0.3.wgt",
|
||||
"downloadAndroidUrl": "http://127.0.0.1/APPServer/wmsapp.1.0.3.wgt"
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 6522 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user