1874 changed files with 182587 additions and 0 deletions
File diff suppressed because it is too large
@ -0,0 +1,20 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" /> |
|||
<PackageReference Include="Microsoft.Extensions.Http" /> |
|||
<PackageReference Include="Octokit" /> |
|||
<PackageReference Include="Polly" /> |
|||
<PackageReference Include="Volo.Abp.Ddd.Domain" /> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
<PackageReference Include="Volo.Abp.Threading" /> |
|||
<PackageReference Include="SharpZipLib" Version="1.3.3" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,17 @@ |
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
public class AbpCliOptions |
|||
{ |
|||
public Dictionary<string, Type> Commands { get; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// Default value: "abppro".
|
|||
/// </summary>
|
|||
public string ToolName { get; set; } = "abppro"; |
|||
|
|||
public AbpCliOptions() |
|||
{ |
|||
Commands = new Dictionary<string, Type>(StringComparer.OrdinalIgnoreCase); |
|||
} |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
using Lion.AbpPro.Cli.Commands; |
|||
using Volo.Abp.Domain; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpDddDomainModule) |
|||
)] |
|||
public class AbpProCliCoreModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpCliOptions>(options => { options.Commands[HelpCommand.Name] = typeof(HelpCommand); }); |
|||
Configure<AbpCliOptions>(options => { options.Commands[NewCommand.Name] = typeof(NewCommand); }); |
|||
|
|||
Configure<Options.LionAbpProOptions>(options => |
|||
{ |
|||
options.Owner = "WangJunZzz"; |
|||
options.RepositoryId = "abp-vnext-pro"; |
|||
options.Token = "abp-vnext-proghp_47vqiabp-vnext-provNkHKJguOJkdHvnxUabp-vnext-protij7Qbdn1Qy3fUabp-vnext-pro"; |
|||
options.Templates = new List<LionAbpProTemplateOptions>() |
|||
{ |
|||
new LionAbpProTemplateOptions("abp-vnext-pro", "abp.vnext.pro", "源码版本", true) |
|||
{ |
|||
ExcludeFiles = "templates,docs,.github,LICENSE,Readme.md", |
|||
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env", |
|||
}, |
|||
new LionAbpProTemplateOptions("abp-vnext-pro-nuget-all", "abp.vnext.pro.nuget.all", "Nuget完整版本") |
|||
{ |
|||
ExcludeFiles = "aspnet-core,vben28,abp-vnext-pro-nuget-module,abp-vnext-pro-nuget-simplify,docs,.github,LICENSE,Readme.md", |
|||
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env", |
|||
}, |
|||
new LionAbpProTemplateOptions("abp-vnext-pro-nuget-simplify", "abp.vnext.pro.nuget.simplify", "Nuget简单版本") |
|||
{ |
|||
ExcludeFiles = "aspnet-core,vben28,abp-vnext-pro-nuget-module,abp-vnext-pro-nuget-all,docs,.github,LICENSE,Readme.md", |
|||
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env", |
|||
}, |
|||
|
|||
new LionAbpProTemplateOptions("abp-vnext-pro-nuget-module", "abp.vnext.pro.nuget.module", "模块") |
|||
{ |
|||
ExcludeFiles = "aspnet-core,vben28,abp-vnext-pro-nuget-all,abp-vnext-pro-nuget-simplify,docs,.github,LICENSE,Readme.md", |
|||
ReplaceSuffix = ".sln,.csproj,.cs,.cshtml,.json,.ci,.yml,.yaml,.nswag,.DotSettings,.env", |
|||
}, |
|||
}; |
|||
}); |
|||
|
|||
context.Services.AddHttpClient(); |
|||
} |
|||
} |
|||
@ -0,0 +1,61 @@ |
|||
using Lion.AbpPro.Cli.Commands; |
|||
|
|||
namespace Lion.AbpPro.Cli.Args; |
|||
|
|||
public class CommandLineArgs |
|||
{ |
|||
public string Command { get; } |
|||
|
|||
public string Target { get; } |
|||
|
|||
|
|||
public AbpCommandLineOptions Options { get; } |
|||
|
|||
public CommandLineArgs(string command = null, string target = null) |
|||
{ |
|||
Command = command; |
|||
Target = target; |
|||
Options = new AbpCommandLineOptions(); |
|||
} |
|||
|
|||
public static CommandLineArgs Empty() |
|||
{ |
|||
return new CommandLineArgs(); |
|||
} |
|||
|
|||
public bool IsCommand(string command) |
|||
{ |
|||
return string.Equals(Command, command, StringComparison.OrdinalIgnoreCase); |
|||
} |
|||
|
|||
public override string ToString() |
|||
{ |
|||
var sb = new StringBuilder(); |
|||
|
|||
if (Command != null) |
|||
{ |
|||
sb.AppendLine($"Command: {Command}"); |
|||
} |
|||
|
|||
if (Target != null) |
|||
{ |
|||
sb.AppendLine($"Target: {Target}"); |
|||
} |
|||
|
|||
if (Options.Any()) |
|||
{ |
|||
sb.AppendLine("Options:"); |
|||
foreach (var option in Options) |
|||
{ |
|||
sb.AppendLine($" - {option.Key} = {option.Value}"); |
|||
} |
|||
} |
|||
|
|||
if (sb.Length <= 0) |
|||
{ |
|||
sb.Append("<EMPTY>"); |
|||
} |
|||
|
|||
return sb.ToString(); |
|||
} |
|||
} |
|||
@ -0,0 +1,144 @@ |
|||
namespace Lion.AbpPro.Cli.Args; |
|||
|
|||
public class CommandLineArgumentParser : ICommandLineArgumentParser, ITransientDependency |
|||
{ |
|||
public CommandLineArgs Parse(string[] args) |
|||
{ |
|||
if (args.IsNullOrEmpty()) |
|||
{ |
|||
return CommandLineArgs.Empty(); |
|||
} |
|||
|
|||
var argumentList = args.ToList(); |
|||
|
|||
//Command
|
|||
|
|||
var command = argumentList[0]; |
|||
argumentList.RemoveAt(0); |
|||
|
|||
if (!argumentList.Any()) |
|||
{ |
|||
return new CommandLineArgs(command); |
|||
} |
|||
|
|||
//Target
|
|||
|
|||
var target = argumentList[0]; |
|||
if (target.StartsWith("-")) |
|||
{ |
|||
target = null; |
|||
} |
|||
else |
|||
{ |
|||
argumentList.RemoveAt(0); |
|||
} |
|||
|
|||
if (!argumentList.Any()) |
|||
{ |
|||
return new CommandLineArgs(command, target); |
|||
} |
|||
|
|||
//Options
|
|||
|
|||
var commandLineArgs = new CommandLineArgs(command, target); |
|||
|
|||
while (argumentList.Any()) |
|||
{ |
|||
var optionName = ParseOptionName(argumentList[0]); |
|||
argumentList.RemoveAt(0); |
|||
|
|||
if (!argumentList.Any()) |
|||
{ |
|||
commandLineArgs.Options[optionName] = null; |
|||
break; |
|||
} |
|||
|
|||
if (IsOptionName(argumentList[0])) |
|||
{ |
|||
commandLineArgs.Options[optionName] = null; |
|||
continue; |
|||
} |
|||
|
|||
commandLineArgs.Options[optionName] = argumentList[0]; |
|||
argumentList.RemoveAt(0); |
|||
} |
|||
|
|||
return commandLineArgs; |
|||
} |
|||
|
|||
public CommandLineArgs Parse(string lineText) |
|||
{ |
|||
return Parse(GetArgsArrayFromLine(lineText)); |
|||
} |
|||
|
|||
private static bool IsOptionName(string argument) |
|||
{ |
|||
return argument.StartsWith("-") || argument.StartsWith("--"); |
|||
} |
|||
|
|||
private static string ParseOptionName(string argument) |
|||
{ |
|||
if (argument.StartsWith("--")) |
|||
{ |
|||
if (argument.Length <= 2) |
|||
{ |
|||
throw new ArgumentException("Should specify an option name after '--' prefix!"); |
|||
} |
|||
|
|||
return argument.RemovePreFix("--"); |
|||
} |
|||
|
|||
if (argument.StartsWith("-")) |
|||
{ |
|||
if (argument.Length <= 1) |
|||
{ |
|||
throw new ArgumentException("Should specify an option name after '-' prefix!"); |
|||
} |
|||
|
|||
return argument.RemovePreFix("-"); |
|||
} |
|||
|
|||
throw new ArgumentException("Option names should start with '-' or '--'."); |
|||
} |
|||
|
|||
private static string[] GetArgsArrayFromLine(string lineText) |
|||
{ |
|||
var args = new List<string>(); |
|||
var currentArgBuilder = new StringBuilder(); |
|||
string currentArg = null; |
|||
bool isInQuotes = false; |
|||
for (int i = 0; i < lineText.Length; i++) |
|||
{ |
|||
var c = lineText[i]; |
|||
if (c == ' ' && !isInQuotes) |
|||
{ |
|||
currentArg = currentArgBuilder.ToString(); |
|||
if (!currentArg.IsNullOrWhiteSpace()) |
|||
{ |
|||
args.Add(currentArg); |
|||
} |
|||
|
|||
currentArgBuilder = new StringBuilder(); |
|||
} |
|||
else |
|||
{ |
|||
if (c == '\"') |
|||
{ |
|||
isInQuotes = !isInQuotes; |
|||
} |
|||
else |
|||
{ |
|||
currentArgBuilder.Append(c); |
|||
} |
|||
} |
|||
} |
|||
|
|||
currentArg = currentArgBuilder.ToString(); |
|||
if (!currentArg.IsNullOrWhiteSpace()) |
|||
{ |
|||
args.Add(currentArg); |
|||
} |
|||
|
|||
return args.ToArray(); |
|||
} |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
namespace Lion.AbpPro.Cli.Args; |
|||
|
|||
public static class CommandOptions |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 模板
|
|||
/// </summary>
|
|||
public static class Template |
|||
{ |
|||
public const string Short = "t"; |
|||
public const string Long = "template"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 公司名称
|
|||
/// </summary>
|
|||
public static class Company |
|||
{ |
|||
public const string Short = "c"; |
|||
public const string Long = "company"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 项目名称
|
|||
/// </summary>
|
|||
public static class Project |
|||
{ |
|||
public const string Short = "p"; |
|||
public const string Long = "project"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 模块名称
|
|||
/// </summary>
|
|||
public static class Module |
|||
{ |
|||
public const string Short = "m"; |
|||
public const string Long = "modulle"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 输出目录
|
|||
/// </summary>
|
|||
public static class OutputFolder |
|||
{ |
|||
public const string Short = "o"; |
|||
public const string Long = "output"; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 版本
|
|||
/// </summary>
|
|||
public static class Version |
|||
{ |
|||
public const string Short = "v"; |
|||
public const string Long = "version"; |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
namespace Lion.AbpPro.Cli.Args; |
|||
|
|||
public interface ICommandLineArgumentParser |
|||
{ |
|||
CommandLineArgs Parse(string[] args); |
|||
|
|||
CommandLineArgs Parse(string lineText); |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
public class CliPaths |
|||
{ |
|||
public static string Log => Path.Combine(AbpRootPath, "logs"); |
|||
|
|||
public static string TemplateCache => Path.Combine(AbpRootPath, "templates"); |
|||
|
|||
public static readonly string AbpRootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".abp.pro"); |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
using Lion.AbpPro.Cli.Commands; |
|||
using Lion.AbpPro.Cli.Cryptography; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
public class CliService : DomainService |
|||
{ |
|||
private readonly ICommandLineArgumentParser _commandLineArgumentParser; |
|||
private readonly ICommandSelector _commandSelector; |
|||
private readonly IServiceScopeFactory _serviceScopeFactory; |
|||
private readonly AbpCliOptions _abpCliOptions; |
|||
|
|||
public CliService(ICommandLineArgumentParser commandLineArgumentParser, |
|||
ICommandSelector commandSelector, |
|||
IServiceScopeFactory serviceScopeFactory, |
|||
IOptions<AbpCliOptions> abpCliOptions) |
|||
{ |
|||
_commandLineArgumentParser = commandLineArgumentParser; |
|||
_commandSelector = commandSelector; |
|||
_serviceScopeFactory = serviceScopeFactory; |
|||
_abpCliOptions = abpCliOptions.Value; |
|||
} |
|||
|
|||
public async Task RunAsync(string[] args) |
|||
{ |
|||
Logger.LogInformation("ABP Pro CLI (https://https://doc.cncore.club/)"); |
|||
Logger.LogInformation("请输入 lion.abp help 查看所有命令"); |
|||
try |
|||
{ |
|||
var commandLineArgs = _commandLineArgumentParser.Parse(args); |
|||
await RunInternalAsync(commandLineArgs); |
|||
} |
|||
|
|||
catch (Exception ex) |
|||
{ |
|||
Logger.LogException(ex); |
|||
} |
|||
} |
|||
|
|||
private async Task RunInternalAsync(CommandLineArgs commandLineArgs) |
|||
{ |
|||
var commandType = _commandSelector.Select(commandLineArgs); |
|||
using (var scope = _serviceScopeFactory.CreateScope()) |
|||
{ |
|||
var command = (IConsoleCommand)scope.ServiceProvider.GetRequiredService(commandType); |
|||
await command.ExecuteAsync(commandLineArgs); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public class AbpCommandLineOptions : Dictionary<string, string> |
|||
{ |
|||
public string GetOrNull(string name, params string[] alternativeNames) |
|||
{ |
|||
Check.NotNullOrWhiteSpace(name, nameof(name)); |
|||
|
|||
var value = this.GetOrDefault(name); |
|||
if (!value.IsNullOrWhiteSpace()) |
|||
{ |
|||
return value; |
|||
} |
|||
|
|||
if (!alternativeNames.IsNullOrEmpty()) |
|||
{ |
|||
foreach (var alternativeName in alternativeNames) |
|||
{ |
|||
value = this.GetOrDefault(alternativeName); |
|||
if (!value.IsNullOrWhiteSpace()) |
|||
{ |
|||
return value; |
|||
} |
|||
} |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public class CommandSelector : ICommandSelector, ITransientDependency |
|||
{ |
|||
private readonly AbpCliOptions _options; |
|||
|
|||
public CommandSelector(IOptions<AbpCliOptions> options) |
|||
{ |
|||
_options = options.Value; |
|||
} |
|||
|
|||
public Type Select(CommandLineArgs commandLineArgs) |
|||
{ |
|||
if (commandLineArgs.Command.IsNullOrWhiteSpace()) |
|||
{ |
|||
return typeof(HelpCommand); |
|||
} |
|||
|
|||
return _options.Commands.GetOrDefault(commandLineArgs.Command) |
|||
?? typeof(HelpCommand); |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public class HelpCommand : IConsoleCommand, ITransientDependency |
|||
{ |
|||
public const string Name = "help"; |
|||
private readonly ILogger<HelpCommand> _logger; |
|||
private readonly AbpCliOptions _abpCliOptions; |
|||
private readonly IServiceScopeFactory _serviceScopeFactory; |
|||
|
|||
public HelpCommand(IOptions<AbpCliOptions> abpCliOptions, |
|||
ILogger<HelpCommand> logger, |
|||
IServiceScopeFactory serviceScopeFactory) |
|||
{ |
|||
_logger = logger; |
|||
_serviceScopeFactory = serviceScopeFactory; |
|||
_abpCliOptions = abpCliOptions.Value; |
|||
} |
|||
|
|||
public Task ExecuteAsync(CommandLineArgs commandLineArgs) |
|||
{ |
|||
GetUsageInfo(); |
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
public void GetUsageInfo() |
|||
{ |
|||
var sb = new StringBuilder(); |
|||
|
|||
sb.AppendLine("查看命令帮助:"); |
|||
sb.AppendLine(" lion.abp help"); |
|||
sb.AppendLine("命令列表:"); |
|||
|
|||
foreach (var command in _abpCliOptions.Commands.ToArray()) |
|||
{ |
|||
string shortDescription; |
|||
|
|||
using (var scope = _serviceScopeFactory.CreateScope()) |
|||
{ |
|||
shortDescription = ((IConsoleCommand)scope.ServiceProvider |
|||
.GetRequiredService(command.Value)).GetShortDescription(); |
|||
} |
|||
|
|||
sb.Append(" > "); |
|||
sb.Append(command.Key); |
|||
sb.Append(string.IsNullOrWhiteSpace(shortDescription) ? "" : ":"); |
|||
sb.Append(" "); |
|||
sb.AppendLine(shortDescription); |
|||
} |
|||
|
|||
_logger.LogInformation(sb.ToString()); |
|||
} |
|||
|
|||
public string GetShortDescription() |
|||
{ |
|||
return "lion.abp help"; |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public interface ICommandSelector |
|||
{ |
|||
Type Select(CommandLineArgs commandLineArgs); |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public interface IConsoleCommand |
|||
{ |
|||
Task ExecuteAsync(CommandLineArgs commandLineArgs); |
|||
|
|||
void GetUsageInfo(); |
|||
|
|||
string GetShortDescription(); |
|||
} |
|||
@ -0,0 +1,150 @@ |
|||
using System.Diagnostics; |
|||
using Lion.AbpPro.Cli.SourceCode; |
|||
|
|||
namespace Lion.AbpPro.Cli.Commands; |
|||
|
|||
public class NewCommand : IConsoleCommand, ITransientDependency |
|||
{ |
|||
public const string Name = "new"; |
|||
private readonly ILogger<NewCommand> _logger; |
|||
private readonly AbpCliOptions _abpCliOptions; |
|||
private readonly IServiceScopeFactory _serviceScopeFactory; |
|||
private readonly Options.LionAbpProOptions _options; |
|||
private readonly ISourceCodeManager _sourceCodeManager; |
|||
|
|||
public NewCommand( |
|||
IOptions<AbpCliOptions> abpCliOptions, |
|||
ILogger<NewCommand> logger, |
|||
IServiceScopeFactory serviceScopeFactory, |
|||
IOptions<Options.LionAbpProOptions> options, |
|||
ISourceCodeManager sourceCodeManager) |
|||
{ |
|||
_logger = logger; |
|||
_serviceScopeFactory = serviceScopeFactory; |
|||
_sourceCodeManager = sourceCodeManager; |
|||
_options = options.Value; |
|||
_abpCliOptions = abpCliOptions.Value; |
|||
} |
|||
|
|||
public async Task ExecuteAsync(CommandLineArgs commandLineArgs) |
|||
{ |
|||
#region 参数获取
|
|||
|
|||
var context = new SourceCodeContext |
|||
{ |
|||
OldCompanyName = _options.OldCompanyName, |
|||
OldProjectName = _options.OldProjectName |
|||
}; |
|||
// 检查模板是否正确
|
|||
var template = commandLineArgs.Options.GetOrNull(CommandOptions.Template.Short, CommandOptions.Template.Long); |
|||
if (template.IsNullOrWhiteSpace()) |
|||
{ |
|||
_logger.LogError("请输入模板名称"); |
|||
GetUsageInfo(); |
|||
return; |
|||
} |
|||
|
|||
var templateOptions = _options.Templates.FirstOrDefault(e => e.Name == template); |
|||
if (templateOptions == null) |
|||
{ |
|||
_logger.LogError("模板类型不正确"); |
|||
GetUsageInfo(); |
|||
return; |
|||
} |
|||
|
|||
context.RepositoryId = _options.RepositoryId; |
|||
context.Token = _options.DecryptToken; |
|||
context.Owner = _options.Owner; |
|||
context.TemplateName = templateOptions.Name; |
|||
context.TemplateKey = templateOptions.Key; |
|||
context.IsSource = templateOptions.IsSource; |
|||
context.ExcludeFiles = templateOptions.ExcludeFiles; |
|||
context.ReplaceSuffix = templateOptions.ReplaceSuffix; |
|||
// if (commandLineArgs.Target.IsNullOrWhiteSpace())
|
|||
// {
|
|||
// GetUsageInfo();
|
|||
// return;
|
|||
// }
|
|||
|
|||
//校验是否输入公司名称
|
|||
context.CompanyName = commandLineArgs.Options.GetOrNull(CommandOptions.Company.Short, CommandOptions.Company.Long); |
|||
if (context.CompanyName.IsNullOrWhiteSpace()) |
|||
{ |
|||
_logger.LogError("请输入公司名称"); |
|||
GetUsageInfo(); |
|||
return; |
|||
} |
|||
|
|||
//校验是否输入项目名称
|
|||
context.ProjectName = commandLineArgs.Options.GetOrNull(CommandOptions.Project.Short, CommandOptions.Project.Long); |
|||
if (context.ProjectName.IsNullOrWhiteSpace()) |
|||
{ |
|||
_logger.LogError("请输入项目名称"); |
|||
GetUsageInfo(); |
|||
return; |
|||
} |
|||
|
|||
var outputFolder = commandLineArgs.Options.GetOrNull(CommandOptions.OutputFolder.Short, CommandOptions.OutputFolder.Long); |
|||
|
|||
outputFolder = outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(); |
|||
|
|||
context.OutputFolder = outputFolder; |
|||
//版本
|
|||
var version = commandLineArgs.Options.GetOrNull(CommandOptions.Version.Short, CommandOptions.Version.Long); |
|||
|
|||
#endregion
|
|||
|
|||
// 获取源码
|
|||
context.TemplateFile = await _sourceCodeManager.GetAsync(version); |
|||
|
|||
// 解压
|
|||
_sourceCodeManager.ExtractProjectZip(context); |
|||
|
|||
// 替换模板
|
|||
_sourceCodeManager.ReplaceTemplates(context); |
|||
|
|||
// 打开文件夹
|
|||
Process.Start("explorer.exe", context.OutputFolder); |
|||
} |
|||
|
|||
public void GetUsageInfo() |
|||
{ |
|||
var sb = new StringBuilder(); |
|||
|
|||
sb.AppendLine("查看命令帮助:"); |
|||
sb.AppendLine(" lion.abp help"); |
|||
sb.AppendLine("命令列表:"); |
|||
|
|||
foreach (var command in _abpCliOptions.Commands.ToArray()) |
|||
{ |
|||
string shortDescription; |
|||
|
|||
using (var scope = _serviceScopeFactory.CreateScope()) |
|||
{ |
|||
shortDescription = ((IConsoleCommand)scope.ServiceProvider |
|||
.GetRequiredService(command.Value)).GetShortDescription(); |
|||
} |
|||
|
|||
sb.Append(" > "); |
|||
sb.Append(command.Key); |
|||
sb.Append(string.IsNullOrWhiteSpace(shortDescription) ? "" : ":"); |
|||
sb.Append(" "); |
|||
sb.AppendLine(shortDescription); |
|||
} |
|||
|
|||
_logger.LogInformation(sb.ToString()); |
|||
} |
|||
|
|||
public string GetShortDescription() |
|||
{ |
|||
var message = Environment.NewLine; |
|||
message += $" > lion.abp new abp-vnext-pro -c 公司名称 -p 项目名称 -v 版本(默认LastRelease)"; |
|||
message += Environment.NewLine; |
|||
message += $" > lion.abp new abp-vnext-pro-basic -c 公司名称 -p 项目名称 -v 版本(默认LastRelease)"; |
|||
message += Environment.NewLine; |
|||
message += $" > lion.abp new abp-vnext-pro-basic-no-ocelot -c 公司名称 -p 项目名称 -v 版本(默认LastRelease)"; |
|||
message += Environment.NewLine; |
|||
message += $" > lion.abp new abp-vnext-pro-module -c 公司名称 -p 项目名称 -m 模块名称 -v 版本(默认LastRelease)"; |
|||
return message; |
|||
} |
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
using Volo.Abp.Domain.Services; |
|||
using Volo.Abp.Json; |
|||
|
|||
namespace Lion.AbpPro.Cli.NuGet; |
|||
|
|||
public class NuGetService : DomainService |
|||
{ |
|||
private readonly IHttpClientFactory _clientFactory; |
|||
private readonly IJsonSerializer _jsonSerializer; |
|||
|
|||
public NuGetService(IHttpClientFactory clientFactory, IJsonSerializer jsonSerializer) |
|||
{ |
|||
_clientFactory = clientFactory; |
|||
_jsonSerializer = jsonSerializer; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 从nuget服务获取最新的版本
|
|||
/// </summary>
|
|||
/// <param name="packageId">nuget包</param>
|
|||
/// <returns></returns>
|
|||
public async Task<string> GetLatestVersionOrNullAsync(string packageId) |
|||
{ |
|||
var versionList = await GetPackageVersionsFromNuGetOrgAsync(packageId); |
|||
return versionList.MaxBy(e => e); |
|||
} |
|||
|
|||
private async Task<List<string>> GetPackageVersionsFromNuGetOrgAsync(string packageId) |
|||
{ |
|||
var url = $"https://api.nuget.org/v3-flatcontainer/{packageId.ToLowerInvariant()}/index.json"; |
|||
return await GetPackageVersionListFromUrlWithRetryAsync(url); |
|||
} |
|||
|
|||
|
|||
private async Task<List<string>> GetPackageVersionListFromUrlWithRetryAsync(string url) |
|||
{ |
|||
var exceptionRetryPolicy = CreateExceptionRetryPolicy(); |
|||
var timeoutRetryPolicy = CreateTimeoutRetryPolicy(); |
|||
var policy = Policy.WrapAsync(exceptionRetryPolicy,timeoutRetryPolicy); |
|||
|
|||
var result = await policy.ExecuteAsync(async () => await GetPackageVersionListFromUrlAsync(url)); |
|||
return result; |
|||
} |
|||
|
|||
private async Task<List<string>> GetPackageVersionListFromUrlAsync(string url) |
|||
{ |
|||
var client = _clientFactory.CreateClient(); |
|||
var response = await client.GetAsync(url); |
|||
response.EnsureSuccessStatusCode(); |
|||
var content = await response.Content.ReadAsStringAsync(); |
|||
if (content.IsNullOrWhiteSpace()) return null; |
|||
return _jsonSerializer.Deserialize<NuGetVersionResultDto>(content).Versions; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建异常重试策略
|
|||
/// </summary>
|
|||
private AsyncRetryPolicy CreateExceptionRetryPolicy() |
|||
{ |
|||
var policy = Policy.Handle<Exception>((ex) => |
|||
{ |
|||
var result = !ex.Message.IsNullOrWhiteSpace(); |
|||
return result; |
|||
}) |
|||
.WaitAndRetryAsync(3, |
|||
(retryCount) => TimeSpan.FromSeconds(Math.Pow(2, retryCount)), (ex, time, retryCount, context) => |
|||
{ |
|||
if (retryCount == 3) |
|||
{ |
|||
Logger.LogError($"请求nuget.org失败,已重试第 {retryCount} 次."); |
|||
} |
|||
}); |
|||
|
|||
return policy; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建超时重试策略
|
|||
/// </summary>
|
|||
private AsyncRetryPolicy CreateTimeoutRetryPolicy() |
|||
{ |
|||
var timeOutPolicy = Policy.Handle<Exception>((ex) => |
|||
{ |
|||
var result = |
|||
ex.InnerException != null && |
|||
ex.InnerException.GetType() == typeof(TimeoutException); |
|||
return result; |
|||
}) |
|||
.WaitAndRetryAsync(3, |
|||
(retryCount) => TimeSpan.FromSeconds(Math.Pow(2, retryCount)), |
|||
(ex, time, retryCount, context) => |
|||
{ |
|||
if (retryCount == 3) |
|||
{ |
|||
Logger.LogError($"请求nuget.org超时,已重试第 {retryCount} 次,请重新执行命令."); |
|||
} |
|||
}); |
|||
return timeOutPolicy; |
|||
} |
|||
} |
|||
|
|||
public class NuGetVersionResultDto |
|||
{ |
|||
public List<string> Versions { get; set; } |
|||
} |
|||
@ -0,0 +1,191 @@ |
|||
using System.Diagnostics; |
|||
using System.Runtime.InteropServices; |
|||
|
|||
namespace Lion.AbpPro.Cli.Utils; |
|||
|
|||
public class CmdHelper : ITransientDependency |
|||
{ |
|||
private const int SuccessfulExitCode = 0; |
|||
|
|||
public void OpenWebPage(string url) |
|||
{ |
|||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) |
|||
{ |
|||
url = url.Replace("&", "^&"); |
|||
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true }); |
|||
} |
|||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
|||
{ |
|||
Process.Start("xdg-open", url); |
|||
} |
|||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) |
|||
{ |
|||
Process.Start("open", url); |
|||
} |
|||
} |
|||
|
|||
|
|||
public void Run(string file, |
|||
string arguments) |
|||
{ |
|||
var procStartInfo = new ProcessStartInfo(file, arguments); |
|||
Process.Start(procStartInfo)?.WaitForExit(); |
|||
} |
|||
|
|||
public void RunCmd(string command, |
|||
string workingDirectory = null) |
|||
{ |
|||
RunCmd(command, out _, workingDirectory); |
|||
} |
|||
|
|||
public void RunCmd(string command, |
|||
out int exitCode, |
|||
string workingDirectory = null) |
|||
{ |
|||
var procStartInfo = new ProcessStartInfo( |
|||
GetFileName(), |
|||
GetArguments(command) |
|||
); |
|||
|
|||
if (!string.IsNullOrEmpty(workingDirectory)) |
|||
{ |
|||
procStartInfo.WorkingDirectory = workingDirectory; |
|||
} |
|||
|
|||
using (var process = Process.Start(procStartInfo)) |
|||
{ |
|||
process?.WaitForExit(); |
|||
|
|||
exitCode = process.ExitCode; |
|||
} |
|||
} |
|||
|
|||
public Process RunCmdAndGetProcess(string command, |
|||
string workingDirectory = null) |
|||
{ |
|||
var procStartInfo = new ProcessStartInfo( |
|||
GetFileName(), |
|||
GetArguments(command) |
|||
); |
|||
|
|||
if (!string.IsNullOrEmpty(workingDirectory)) |
|||
{ |
|||
procStartInfo.WorkingDirectory = workingDirectory; |
|||
procStartInfo.CreateNoWindow = false; |
|||
} |
|||
|
|||
return Process.Start(procStartInfo); |
|||
} |
|||
|
|||
public string RunCmdAndGetOutput(string command, |
|||
string workingDirectory = null) |
|||
{ |
|||
return RunCmdAndGetOutput(command, out int _, workingDirectory); |
|||
} |
|||
|
|||
public string RunCmdAndGetOutput(string command, |
|||
out bool isExitCodeSuccessful, |
|||
string workingDirectory = null) |
|||
{ |
|||
var output = RunCmdAndGetOutput(command, out int exitCode, workingDirectory); |
|||
isExitCodeSuccessful = exitCode == SuccessfulExitCode; |
|||
return output; |
|||
} |
|||
|
|||
public string RunCmdAndGetOutput(string command, |
|||
out int exitCode, |
|||
string workingDirectory = null) |
|||
{ |
|||
string output; |
|||
|
|||
using (var process = new Process()) |
|||
{ |
|||
process.StartInfo = new ProcessStartInfo(GetFileName()) |
|||
{ |
|||
Arguments = GetArguments(command), |
|||
UseShellExecute = false, |
|||
CreateNoWindow = true, |
|||
RedirectStandardOutput = true, |
|||
RedirectStandardError = true |
|||
}; |
|||
|
|||
if (!string.IsNullOrEmpty(workingDirectory)) |
|||
{ |
|||
process.StartInfo.WorkingDirectory = workingDirectory; |
|||
} |
|||
|
|||
process.Start(); |
|||
|
|||
using (var standardOutput = process.StandardOutput) |
|||
{ |
|||
using (var standardError = process.StandardError) |
|||
{ |
|||
output = standardOutput.ReadToEnd(); |
|||
output += standardError.ReadToEnd(); |
|||
} |
|||
} |
|||
|
|||
process.WaitForExit(); |
|||
|
|||
exitCode = process.ExitCode; |
|||
} |
|||
|
|||
return output.Trim(); |
|||
} |
|||
|
|||
public void RunCmdAndExit(string command, |
|||
string workingDirectory = null, |
|||
int? delaySeconds = null) |
|||
{ |
|||
var procStartInfo = new ProcessStartInfo( |
|||
GetFileName(), |
|||
GetArguments(command, delaySeconds) |
|||
); |
|||
|
|||
if (!string.IsNullOrEmpty(workingDirectory)) |
|||
{ |
|||
procStartInfo.WorkingDirectory = workingDirectory; |
|||
} |
|||
|
|||
Process.Start(procStartInfo); |
|||
Environment.Exit(0); |
|||
} |
|||
|
|||
public string GetArguments(string command, |
|||
int? delaySeconds = null) |
|||
{ |
|||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
|||
{ |
|||
return delaySeconds == null ? "-c \"" + command + "\"" : "-c \"" + $"sleep {delaySeconds}s > /dev/null && " + command + "\""; |
|||
} |
|||
|
|||
//Windows default.
|
|||
return delaySeconds == null ? "/C \"" + command + "\"" : "/C \"" + $"timeout /nobreak /t {delaySeconds} >null && " + command + "\""; |
|||
} |
|||
|
|||
public string GetFileName() |
|||
{ |
|||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) |
|||
{ |
|||
//Windows
|
|||
return "cmd.exe"; |
|||
} |
|||
|
|||
//Linux or OSX
|
|||
if (File.Exists("/bin/bash")) |
|||
{ |
|||
return "/bin/bash"; |
|||
} |
|||
|
|||
if (File.Exists("/bin/sh")) |
|||
{ |
|||
return "/bin/sh"; //some Linux distributions like Alpine doesn't have bash
|
|||
} |
|||
|
|||
throw new AbpException($"Cannot determine shell command for this OS! " + |
|||
$"Running on OS: {System.Runtime.InteropServices.RuntimeInformation.OSDescription} | " + |
|||
$"OS Architecture: {System.Runtime.InteropServices.RuntimeInformation.OSArchitecture} | " + |
|||
$"Framework: {System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription} | " + |
|||
$"Process Architecture{System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture}"); |
|||
} |
|||
} |
|||
@ -0,0 +1,100 @@ |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Lion.AbpPro.Cli.Zip; |
|||
|
|||
public static class DirectoryAndFileHelper |
|||
{ |
|||
/// <summary>
|
|||
/// 复制文件夹及文件
|
|||
/// </summary>
|
|||
/// <param name="sourceFolder">原文件路径</param>
|
|||
/// <param name="destFolder">目标文件路径</param>
|
|||
/// <param name="excludeFiles">需要排除的文件,多个文件用逗号隔开</param>
|
|||
public static void CopyFolder(string sourceFolder, string destFolder, string excludeFiles = "") |
|||
{ |
|||
try |
|||
{ |
|||
Check.NotNullOrWhiteSpace(sourceFolder, nameof(sourceFolder)); |
|||
Check.NotNullOrWhiteSpace(destFolder, nameof(destFolder)); |
|||
//如果目标路径不存在,则创建目标路径
|
|||
if (!System.IO.Directory.Exists(destFolder)) |
|||
{ |
|||
System.IO.Directory.CreateDirectory(destFolder); |
|||
} |
|||
else |
|||
{ |
|||
DeletedDir(destFolder); |
|||
} |
|||
|
|||
//得到原文件根目录下的所有文件
|
|||
string[] files = System.IO.Directory.GetFiles(sourceFolder); |
|||
foreach (string file in files) |
|||
{ |
|||
string name = System.IO.Path.GetFileName(file); |
|||
string dest = System.IO.Path.Combine(destFolder, name); |
|||
if (!excludeFiles.IsNullOrWhiteSpace()) |
|||
{ |
|||
var excludes = excludeFiles.Split(',', StringSplitOptions.RemoveEmptyEntries); |
|||
if (excludes.Contains(name)) |
|||
{ |
|||
continue; |
|||
} |
|||
} |
|||
|
|||
System.IO.File.Copy(file, dest); //复制文件
|
|||
} |
|||
|
|||
//得到原文件根目录下的所有文件夹
|
|||
string[] folders = System.IO.Directory.GetDirectories(sourceFolder); |
|||
foreach (string folder in folders) |
|||
{ |
|||
string name = System.IO.Path.GetFileName(folder); |
|||
string dest = System.IO.Path.Combine(destFolder, name); |
|||
if (!excludeFiles.IsNullOrWhiteSpace()) |
|||
{ |
|||
var excludes = excludeFiles.Split(',', StringSplitOptions.RemoveEmptyEntries); |
|||
if (excludes.Contains(name)) |
|||
{ |
|||
continue; |
|||
} |
|||
} |
|||
|
|||
|
|||
CopyFolder(folder, dest); //构建目标路径,递归复制文件
|
|||
} |
|||
} |
|||
catch (Exception) |
|||
{ |
|||
throw new UserFriendlyException("复制文件失败!"); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除文件夹及文件
|
|||
/// </summary>
|
|||
/// <param name="srcPath">路径</param>
|
|||
private static void DeletedDir(string srcPath) |
|||
{ |
|||
try |
|||
{ |
|||
DirectoryInfo dir = new DirectoryInfo(srcPath); |
|||
FileSystemInfo[] fileinfo = dir.GetFileSystemInfos(); //返回目录中所有文件和子目录
|
|||
foreach (FileSystemInfo i in fileinfo) |
|||
{ |
|||
if (i is DirectoryInfo) //判断是否文件夹
|
|||
{ |
|||
DirectoryInfo subdir = new DirectoryInfo(i.FullName); |
|||
subdir.Delete(true); //删除子目录和文件
|
|||
} |
|||
else |
|||
{ |
|||
File.Delete(i.FullName); //删除指定文件
|
|||
} |
|||
} |
|||
} |
|||
catch (Exception) |
|||
{ |
|||
throw new UserFriendlyException("删除文件失败!"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,193 @@ |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Lion.AbpPro.Cli.Replace; |
|||
|
|||
public static class ReplaceHelper |
|||
{ |
|||
public static void ReplaceTemplates(string sourcePath, string oldCompanyName, string oldProjectName, string companyName, string projectName, string replaceSuffix) |
|||
{ |
|||
try |
|||
{ |
|||
RenameTemplate(sourcePath, oldCompanyName, oldProjectName, companyName, projectName, replaceSuffix); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw new UserFriendlyException($"生成模板失败{ex.Message}"); |
|||
} |
|||
} |
|||
|
|||
private static void ReplaceTemplates(string sourcePath, string oldCompanyName, string oldProjectName, string oldModuleName, string companyName, string projectName, string moduleName, string replaceSuffix) |
|||
{ |
|||
try |
|||
{ |
|||
RenameTemplate(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
throw new UserFriendlyException($"生成模板失败{ex.Message}"); |
|||
} |
|||
} |
|||
|
|||
private static void RenameTemplate(string sourcePath, string oldCompanyName, string oldProjectName, string companyName, string projectName, string replaceSuffix) |
|||
{ |
|||
RenameAllDirectories(sourcePath, oldCompanyName, oldProjectName, companyName, projectName); |
|||
RenameAllFileNameAndContent(sourcePath, oldCompanyName, oldProjectName, companyName, projectName, replaceSuffix); |
|||
} |
|||
|
|||
private static void RenameTemplate(string sourcePath, string oldCompanyName, string oldProjectName, string oldModuleName, string companyName, string projectName, string moduleName, string replaceSuffix) |
|||
{ |
|||
RenameAllDirectories(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName); |
|||
RenameAllFileNameAndContent(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix); |
|||
} |
|||
|
|||
private static void RenameAllDirectories(string sourcePath, string oldCompanyName, string oldProjectName, string companyName, string projectName) |
|||
{ |
|||
var directories = Directory.GetDirectories(sourcePath); |
|||
foreach (var subDirectory in directories) |
|||
{ |
|||
RenameAllDirectories(subDirectory, oldCompanyName, oldProjectName, companyName, projectName); |
|||
|
|||
var directoryInfo = new DirectoryInfo(subDirectory); |
|||
if (directoryInfo.Name.Contains(oldCompanyName) || |
|||
directoryInfo.Name.Contains(oldProjectName)) |
|||
{ |
|||
var oldDirectoryName = directoryInfo.Name; |
|||
var newDirectoryName = oldDirectoryName.CustomReplace(oldCompanyName, oldProjectName, companyName, projectName); |
|||
|
|||
var newDirectoryPath = Path.Combine(directoryInfo.Parent?.FullName, newDirectoryName); |
|||
|
|||
if (directoryInfo.FullName != newDirectoryPath) |
|||
{ |
|||
directoryInfo.MoveTo(newDirectoryPath); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static void RenameAllDirectories(string sourcePath, string oldCompanyName, string oldProjectName, string oldModuleName, string companyName, string projectName, string moduleName) |
|||
{ |
|||
var directories = Directory.GetDirectories(sourcePath); |
|||
foreach (var subDirectory in directories) |
|||
{ |
|||
RenameAllDirectories(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName); |
|||
|
|||
var directoryInfo = new DirectoryInfo(subDirectory); |
|||
if (directoryInfo.Name.Contains(oldCompanyName) || |
|||
directoryInfo.Name.Contains(oldProjectName) || |
|||
directoryInfo.Name.Contains(oldModuleName)) |
|||
{ |
|||
var oldDirectoryName = directoryInfo.Name; |
|||
var newDirectoryName = oldDirectoryName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName); |
|||
|
|||
var newDirectoryPath = Path.Combine(directoryInfo.Parent?.FullName, newDirectoryName); |
|||
|
|||
if (directoryInfo.FullName != newDirectoryPath) |
|||
{ |
|||
directoryInfo.MoveTo(newDirectoryPath); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
private static void RenameAllFileNameAndContent(string sourcePath, string oldCompanyName, string oldProjectName, string companyName, string projectName, string replaceSuffix) |
|||
{ |
|||
var list = new DirectoryInfo(sourcePath) |
|||
.GetFiles() |
|||
.Where(f => replaceSuffix.Contains(f.Extension)) |
|||
.ToList(); |
|||
|
|||
var encoding = new UTF8Encoding(false); |
|||
foreach (var fileInfo in list) |
|||
{ |
|||
// 改文件内容
|
|||
var oldContents = File.ReadAllText(fileInfo.FullName, encoding); |
|||
var newContents = oldContents.CustomReplace(oldCompanyName, oldProjectName, companyName, projectName); |
|||
|
|||
// 文件名包含模板关键字
|
|||
if (fileInfo.Name.Contains(oldCompanyName) |
|||
|| fileInfo.Name.Contains(oldProjectName)) |
|||
{ |
|||
var oldFileName = fileInfo.Name; |
|||
var newFileName = oldFileName.CustomReplace(oldCompanyName, oldProjectName, companyName, projectName); |
|||
|
|||
var newFilePath = Path.Combine(fileInfo.DirectoryName, newFileName); |
|||
// 无变化才重命名
|
|||
if (newFilePath != fileInfo.FullName) |
|||
{ |
|||
File.Delete(fileInfo.FullName); |
|||
} |
|||
|
|||
File.WriteAllText(newFilePath, newContents, encoding); |
|||
} |
|||
else |
|||
File.WriteAllText(fileInfo.FullName, newContents, encoding); |
|||
} |
|||
|
|||
foreach (var subDirectory in Directory.GetDirectories(sourcePath)) |
|||
{ |
|||
RenameAllFileNameAndContent(subDirectory, oldCompanyName, oldProjectName, companyName, projectName, replaceSuffix); |
|||
} |
|||
} |
|||
|
|||
private static void RenameAllFileNameAndContent(string sourcePath, string oldCompanyName, string oldProjectName, string oldModuleName, string companyName, string projectName, string moduleName, |
|||
string replaceSuffix) |
|||
{ |
|||
var list = new DirectoryInfo(sourcePath) |
|||
.GetFiles() |
|||
.Where(f => replaceSuffix.Contains(f.Extension)) |
|||
.ToList(); |
|||
|
|||
var encoding = new UTF8Encoding(false); |
|||
foreach (var fileInfo in list) |
|||
{ |
|||
// 改文件内容
|
|||
var oldContents = File.ReadAllText(fileInfo.FullName, encoding); |
|||
var newContents = oldContents.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName); |
|||
|
|||
// 文件名包含模板关键字
|
|||
if (fileInfo.Name.Contains(oldCompanyName) |
|||
|| fileInfo.Name.Contains(oldProjectName) |
|||
|| fileInfo.Name.Contains(oldModuleName)) |
|||
{ |
|||
var oldFileName = fileInfo.Name; |
|||
var newFileName = oldFileName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName); |
|||
|
|||
var newFilePath = Path.Combine(fileInfo.DirectoryName, newFileName); |
|||
// 无变化才重命名
|
|||
if (newFilePath != fileInfo.FullName) |
|||
{ |
|||
File.Delete(fileInfo.FullName); |
|||
} |
|||
|
|||
File.WriteAllText(newFilePath, newContents, encoding); |
|||
} |
|||
else |
|||
File.WriteAllText(fileInfo.FullName, newContents, encoding); |
|||
} |
|||
|
|||
foreach (var subDirectory in Directory.GetDirectories(sourcePath)) |
|||
{ |
|||
RenameAllFileNameAndContent(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix); |
|||
} |
|||
} |
|||
private static string CustomReplace(this string content,string oldCompanyName, string oldProjectName, string companyName,string projectName) |
|||
{ |
|||
var result = content |
|||
.Replace(oldCompanyName, companyName) |
|||
.Replace(oldProjectName, projectName) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
|
|||
private static string CustomReplace(this string content,string oldCompanyName, string oldProjectName,string oldModuleName, string companyName,string projectName,string moduleName) |
|||
{ |
|||
var result = content |
|||
.Replace(oldCompanyName, companyName) |
|||
.Replace(oldProjectName, projectName) |
|||
.Replace(oldModuleName,moduleName) |
|||
; |
|||
|
|||
return result; |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace Lion.AbpPro.Cli.Cryptography; |
|||
|
|||
public static class TokenHelper |
|||
{ |
|||
/// <summary>
|
|||
/// 解密数据
|
|||
/// </summary>
|
|||
/// <param name="data">要解密数据</param>
|
|||
/// <param name="keyContainerName">密匙容器的名称</param>
|
|||
public static string Decrypt(string data, string keyContainerName = "abp-vnext-pro") |
|||
{ |
|||
Check.NotNullOrWhiteSpace(data, nameof(data)); |
|||
return data.Replace(keyContainerName, ""); |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<PackAsTool>true</PackAsTool> |
|||
<PackageId>abp-pro-cli</PackageId> |
|||
<ToolCommandName>abppro</ToolCommandName> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Sinks.Async" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Lion.AbpPro.Cli.Core\Lion.AbpPro.Cli.Core.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,18 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Autofac; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
[DependsOn( |
|||
typeof(Lion.AbpPro.Cli.AbpProCliCoreModule), |
|||
typeof(AbpAutofacModule) |
|||
)] |
|||
public class AbpProCliModule : AbpModule |
|||
{ |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
using System; |
|||
using System.IO; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Serilog; |
|||
using Serilog.Events; |
|||
using Volo.Abp; |
|||
|
|||
namespace Lion.AbpPro.Cli; |
|||
|
|||
public class Program |
|||
{ |
|||
public static async Task Main(string[] args) |
|||
{ |
|||
Log.Logger = new LoggerConfiguration() |
|||
.MinimumLevel.Information() |
|||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) |
|||
.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) |
|||
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Warning) |
|||
.MinimumLevel.Override("Volo.Abp.IdentityModel", LogEventLevel.Information) |
|||
.MinimumLevel.Override("Volo.Abp.Cli", LogEventLevel.Information) |
|||
.Enrich.FromLogContext() |
|||
.WriteTo.File(Path.Combine(CliPaths.Log, "lion.abp-pro-cli-logs.txt")) |
|||
.WriteTo.Console() |
|||
.CreateLogger(); |
|||
using var application = await AbpApplicationFactory.CreateAsync<AbpProCliModule>( |
|||
options => |
|||
{ |
|||
options.UseAutofac(); |
|||
options.Services.AddLogging(c => c.AddSerilog()); |
|||
}); |
|||
await application.InitializeAsync(); |
|||
|
|||
await application.ServiceProvider |
|||
.GetRequiredService<CliService>() |
|||
.RunAsync(args); |
|||
|
|||
await application.ShutdownAsync(); |
|||
|
|||
Log.CloseAndFlush(); |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<ImplicitUsings>enable</ImplicitUsings> |
|||
<IsPackable>false</IsPackable> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" /> |
|||
<PackageReference Include="NSubstitute" /> |
|||
<PackageReference Include="Shouldly" /> |
|||
<PackageReference Include="xunit" /> |
|||
<PackageReference Include="xunit.extensibility.execution" /> |
|||
<PackageReference Include="xunit.runner.visualstudio" /> |
|||
<PackageReference Include="coverlet.collector" /> |
|||
<PackageReference Include="JunitXml.TestLogger" /> |
|||
<PackageReference Include="Volo.Abp.TestBase" /> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Lion.AbpPro.Cli.Core\Lion.AbpPro.Cli.Core.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,285 @@ |
|||
## Ignore Visual Studio temporary files, build results, and |
|||
## files generated by popular Visual Studio add-ons. |
|||
|
|||
# User-specific files |
|||
*.suo |
|||
*.user |
|||
*.userosscache |
|||
*.sln.docstates |
|||
|
|||
# User-specific files (MonoDevelop/Xamarin Studio) |
|||
*.userprefs |
|||
|
|||
# Build results |
|||
[Dd]ebug/ |
|||
[Dd]ebugPublic/ |
|||
[Rr]elease/ |
|||
[Rr]eleases/ |
|||
x64/ |
|||
x86/ |
|||
bld/ |
|||
[Bb]in/ |
|||
[Oo]bj/ |
|||
[Ll]og/ |
|||
|
|||
# Visual Studio 2015 cache/options directory |
|||
.vs/ |
|||
# Uncomment if you have tasks that create the project's static files in wwwroot |
|||
#wwwroot/ |
|||
|
|||
# MSTest test Results |
|||
[Tt]est[Rr]esult*/ |
|||
[Bb]uild[Ll]og.* |
|||
|
|||
# NUNIT |
|||
*.VisualState.xml |
|||
TestResult.xml |
|||
|
|||
# Build Results of an ATL Project |
|||
[Dd]ebugPS/ |
|||
[Rr]eleasePS/ |
|||
dlldata.c |
|||
|
|||
# DNX |
|||
project.lock.json |
|||
artifacts/ |
|||
|
|||
*_i.c |
|||
*_p.c |
|||
*_i.h |
|||
*.ilk |
|||
*.meta |
|||
*.obj |
|||
*.pch |
|||
*.pdb |
|||
*.pgc |
|||
*.pgd |
|||
*.rsp |
|||
*.sbr |
|||
*.tlb |
|||
*.tli |
|||
*.tlh |
|||
*.tmp |
|||
*.tmp_proj |
|||
*.log |
|||
*.vspscc |
|||
*.vssscc |
|||
.builds |
|||
*.pidb |
|||
*.svclog |
|||
*.scc |
|||
|
|||
# Chutzpah Test files |
|||
_Chutzpah* |
|||
|
|||
# Visual C++ cache files |
|||
ipch/ |
|||
*.aps |
|||
*.ncb |
|||
*.opendb |
|||
*.opensdf |
|||
*.sdf |
|||
*.cachefile |
|||
*.VC.db |
|||
*.VC.VC.opendb |
|||
|
|||
# Visual Studio profiler |
|||
*.psess |
|||
*.vsp |
|||
*.vspx |
|||
*.sap |
|||
|
|||
# TFS 2012 Local Workspace |
|||
$tf/ |
|||
|
|||
# Guidance Automation Toolkit |
|||
*.gpState |
|||
|
|||
# ReSharper is a .NET coding add-in |
|||
_ReSharper*/ |
|||
*.[Rr]e[Ss]harper |
|||
*.DotSettings.user |
|||
|
|||
# JustCode is a .NET coding add-in |
|||
.JustCode |
|||
|
|||
# TeamCity is a build add-in |
|||
_TeamCity* |
|||
|
|||
# DotCover is a Code Coverage Tool |
|||
*.dotCover |
|||
|
|||
# NCrunch |
|||
_NCrunch_* |
|||
.*crunch*.local.xml |
|||
nCrunchTemp_* |
|||
|
|||
# MightyMoose |
|||
*.mm.* |
|||
AutoTest.Net/ |
|||
|
|||
# Web workbench (sass) |
|||
.sass-cache/ |
|||
|
|||
# Installshield output folder |
|||
[Ee]xpress/ |
|||
|
|||
# DocProject is a documentation generator add-in |
|||
DocProject/buildhelp/ |
|||
DocProject/Help/*.HxT |
|||
DocProject/Help/*.HxC |
|||
DocProject/Help/*.hhc |
|||
DocProject/Help/*.hhk |
|||
DocProject/Help/*.hhp |
|||
DocProject/Help/Html2 |
|||
DocProject/Help/html |
|||
|
|||
# Click-Once directory |
|||
publish/ |
|||
|
|||
# Publish Web Output |
|||
*.[Pp]ublish.xml |
|||
*.azurePubxml |
|||
# TODO: Comment the next line if you want to checkin your web deploy settings |
|||
# but database connection strings (with potential passwords) will be unencrypted |
|||
*.pubxml |
|||
*.publishproj |
|||
|
|||
# Microsoft Azure Web App publish settings. Comment the next line if you want to |
|||
# checkin your Azure Web App publish settings, but sensitive information contained |
|||
# in these scripts will be unencrypted |
|||
PublishScripts/ |
|||
|
|||
# NuGet Packages |
|||
*.nupkg |
|||
# The packages folder can be ignored because of Package Restore |
|||
**/packages/* |
|||
# except build/, which is used as an MSBuild target. |
|||
!**/packages/build/ |
|||
# Uncomment if necessary however generally it will be regenerated when needed |
|||
#!**/packages/repositories.config |
|||
# NuGet v3's project.json files produces more ignoreable files |
|||
*.nuget.props |
|||
*.nuget.targets |
|||
|
|||
# Microsoft Azure Build Output |
|||
csx/ |
|||
*.build.csdef |
|||
|
|||
# Microsoft Azure Emulator |
|||
ecf/ |
|||
rcf/ |
|||
|
|||
# Windows Store app package directories and files |
|||
AppPackages/ |
|||
BundleArtifacts/ |
|||
Package.StoreAssociation.xml |
|||
_pkginfo.txt |
|||
|
|||
# Visual Studio cache files |
|||
# files ending in .cache can be ignored |
|||
*.[Cc]ache |
|||
# but keep track of directories ending in .cache |
|||
!*.[Cc]ache/ |
|||
|
|||
# Others |
|||
ClientBin/ |
|||
~$* |
|||
*~ |
|||
*.dbmdl |
|||
*.dbproj.schemaview |
|||
*.pfx |
|||
*.publishsettings |
|||
node_modules/ |
|||
orleans.codegen.cs |
|||
|
|||
# Since there are multiple workflows, uncomment next line to ignore bower_components |
|||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) |
|||
#bower_components/ |
|||
|
|||
# RIA/Silverlight projects |
|||
Generated_Code/ |
|||
|
|||
# Backup & report files from converting an old project file |
|||
# to a newer Visual Studio version. Backup files are not needed, |
|||
# because we have git ;-) |
|||
_UpgradeReport_Files/ |
|||
Backup*/ |
|||
UpgradeLog*.XML |
|||
UpgradeLog*.htm |
|||
|
|||
# SQL Server files |
|||
*.mdf |
|||
*.ldf |
|||
|
|||
# Business Intelligence projects |
|||
*.rdl.data |
|||
*.bim.layout |
|||
*.bim_*.settings |
|||
|
|||
# Microsoft Fakes |
|||
FakesAssemblies/ |
|||
|
|||
# GhostDoc plugin setting file |
|||
*.GhostDoc.xml |
|||
|
|||
# Node.js Tools for Visual Studio |
|||
.ntvs_analysis.dat |
|||
|
|||
# Visual Studio 6 build log |
|||
*.plg |
|||
|
|||
# Visual Studio 6 workspace options file |
|||
*.opt |
|||
|
|||
# Visual Studio LightSwitch build output |
|||
**/*.HTMLClient/GeneratedArtifacts |
|||
**/*.DesktopClient/GeneratedArtifacts |
|||
**/*.DesktopClient/ModelManifest.xml |
|||
**/*.Server/GeneratedArtifacts |
|||
**/*.Server/ModelManifest.xml |
|||
_Pvt_Extensions |
|||
|
|||
# Paket dependency manager |
|||
.paket/paket.exe |
|||
paket-files/ |
|||
|
|||
# FAKE - F# Make |
|||
.fake/ |
|||
|
|||
# JetBrains Rider |
|||
.idea/ |
|||
*.sln.iml |
|||
|
|||
# Zzz |
|||
content/src/Zzz.Web/Logs/* |
|||
content/src/Zzz.Web.Host/Logs/* |
|||
content/src/Zzz.IdentityServer/Logs/* |
|||
content/src/Zzz.HttpApi.Host/Logs/* |
|||
content/src/Zzz.HttpApi.Host/Logs/* |
|||
content/src/Zzz.DbMigrator/Logs/* |
|||
/content/aspnetcore/src/Zzz.HttpApi.Host/App_Data |
|||
/aspnet-core/services/src/CompanyName.ProjectName.HttpApi.Host/Logs |
|||
/aspnet-core/services/src/CompanyName.ProjectName.IdentityServer/appsettings.Production.json |
|||
/aspnet-core/services/src/CompanyName.ProjectName.HttpApi.Host/appsettings.Production.json |
|||
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/appsettings.Production.json |
|||
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/Logs |
|||
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/Logs |
|||
/vben271/dist.zip |
|||
/aspnet-core/services/host/CompanyName.ProjectName.HttpApi.Host/publish.zip |
|||
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/appsettings.Production.json |
|||
/aspnet-core/services/host/CompanyName.ProjectName.IdentityServer/publish.zip |
|||
vben271/yarn.lock |
|||
/vben271/_nginx.zip |
|||
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/logs |
|||
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/Logs |
|||
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/Logs |
|||
/aspnet-core/gateways/Lion.AbpPro.WebGateway/appsettings.Production.json |
|||
/aspnet-core/services/host/Lion.AbpPro.IdentityServer/appsettings.Production.json |
|||
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/appsettings.Production.json |
|||
aspnet-core/services/host/Lion.AbpPro.Web.Blazor.Server/Logs/logs.txt |
|||
/nupkgs |
|||
/aspnet-core/Lion.AbpPro.sln.DotSettings |
|||
/aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/logs |
|||
/vben271/package-lock.json |
|||
/docs/site |
|||
@ -0,0 +1,20 @@ |
|||
@ECHO off |
|||
cls |
|||
|
|||
ECHO Deleting all BIN and OBJ folders... |
|||
ECHO. |
|||
|
|||
FOR /d /r . %%d in (bin,obj) DO ( |
|||
IF EXIST "%%d" ( |
|||
ECHO %%d | FIND /I "\node_modules\" > Nul && ( |
|||
ECHO.Skipping: %%d |
|||
) || ( |
|||
ECHO.Deleting: %%d |
|||
rd /s/q "%%d" |
|||
) |
|||
) |
|||
) |
|||
|
|||
ECHO. |
|||
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit. |
|||
pause > nul |
|||
@ -0,0 +1,20 @@ |
|||
@ECHO off |
|||
cls |
|||
|
|||
ECHO Deleting all BIN and OBJ folders... |
|||
ECHO. |
|||
|
|||
FOR /d /r . %%d in (bin,obj) DO ( |
|||
IF EXIST "%%d" ( |
|||
ECHO %%d | FIND /I "\node_modules\" > Nul && ( |
|||
ECHO.Skipping: %%d |
|||
) || ( |
|||
ECHO.Deleting: %%d |
|||
rd /s/q "%%d" |
|||
) |
|||
) |
|||
) |
|||
|
|||
ECHO. |
|||
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit. |
|||
pause > nul |
|||
@ -0,0 +1,34 @@ |
|||
<Project> |
|||
<!-- Lion.AbpPro包--> |
|||
<ItemGroup> |
|||
<PackageReference Update="Lion.AbpPro.Core" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Microservices" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.Shared.Hosting.Gateways" Version="7.2.2.1"/> |
|||
|
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.Application" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.Application.Contracts" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.Domain.Shared" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.EntityFrameworkCore" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.BasicManagement.HttpApi.Client" Version="7.2.2.1"/> |
|||
|
|||
|
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.Application.Contracts" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.Domain.Shared" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.EntityFrameworkCore" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.NotificationManagement.HttpApi.Client" Version="7.2.2.1"/> |
|||
|
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Application.Contracts" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.Domain.Shared" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi" Version="7.2.2.1"/> |
|||
<PackageReference Update="Lion.AbpPro.DataDictionaryManagement.HttpApi.Client" Version="7.2.2.1"/> |
|||
|
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,25 @@ |
|||
<Project> |
|||
<!-- 微软官方包--> |
|||
<ItemGroup> |
|||
<PackageReference Update="Microsoft.Extensions.DependencyModel" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.Extensions.Http" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.EntityFrameworkCore.Proxies" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.Extensions.Http.Polly" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.2"/> |
|||
<PackageReference Update="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.2"/> |
|||
|
|||
<PackageReference Update="Microsoft.Extensions.Hosting" Version="7.0.0" /> |
|||
|
|||
<PackageReference Update="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0"/> |
|||
<PackageReference Update="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0"/> |
|||
<PackageReference Update="Microsoft.CSharp" Version="4.7.0"/> |
|||
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="3.7.0"/> |
|||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.2.0"/> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,93 @@ |
|||
<Project> |
|||
<!-- Volo.Abp官方包--> |
|||
<ItemGroup> |
|||
<PackageReference Update="Volo.Abp.Autofac" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Json" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Validation" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Ddd.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AutoMapper" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.ObjectMapping" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.AspNetCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Caching" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BlobStoring.Aliyun" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BackgroundJobs" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BackgroundJobs.HangFire" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.SignalR" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TestBase" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EntityFrameworkCore.MySQL" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AuditLogging.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Account.Web" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Caching.StackExchangeRedis" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EntityFrameworkCore.PostgreSql" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Serilog" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Swashbuckle" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Ddd.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Ddd.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Authorization" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Dapper" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Mvc" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Http.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.MongoDB" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EntityFrameworkCore.Sqlite" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Http.Client.IdentityModel" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.MultiTenancy" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Account.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.Application" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.ObjectExtending" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Account.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.Application.Contracts" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Emailing" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.Domain.Identity" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BackgroundJobs.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AuditLogging.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.Domain" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.BackgroundJobs.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AuditLogging.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.Domain.Shared" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Account.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.HttpApi" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Account.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Identity.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.PermissionManagement.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.TenantManagement.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.FeatureManagement.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.SettingManagement.HttpApi.Client" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Core" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EntityFrameworkCore" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.TestBase" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EventBus.Kafka" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.EventBus" Version="7.2.2"/> |
|||
<PackageReference Update="Volo.Abp.Kafka" Version="7.2.2"/> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,88 @@ |
|||
<Project> |
|||
|
|||
<Import Project="Directory.Build.Microsoft.targets"/> |
|||
<Import Project="Directory.Build.Volo.targets"/> |
|||
<Import Project="Directory.Build.Lion.targets"/> |
|||
|
|||
<PropertyGroup> |
|||
<LangVersion>latest</LangVersion> |
|||
<Version>1.0.0</Version> |
|||
<NoWarn>$(NoWarn);CS1591;CS0436;NU1504</NoWarn> |
|||
<AbpProjectType>app</AbpProjectType> |
|||
<ImplicitUsings>true</ImplicitUsings> |
|||
<GenerateDocumentationFile>true</GenerateDocumentationFile> |
|||
</PropertyGroup> |
|||
|
|||
<!-- 基础包--> |
|||
<ItemGroup> |
|||
<PackageReference Update="Humanizer.Core.zh-Hans" Version="2.14.1"/> |
|||
|
|||
<PackageReference Update="NSubstitute" Version="4.2.2"/> |
|||
<PackageReference Update="Shouldly" Version="4.0.3"/> |
|||
<PackageReference Update="coverlet.collector" Version="3.1.0"/> |
|||
<PackageReference Update="JunitXml.TestLogger" Version="3.0.98"/> |
|||
|
|||
<PackageReference Update="Mongo2Go" Version="3.1.3"/> |
|||
<PackageReference Update="NEST" Version="7.15.1"/> |
|||
<PackageReference Update="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7"/> |
|||
|
|||
<PackageReference Update="Ocelot" Version="18.0.0"/> |
|||
<PackageReference Update="Ocelot.Provider.Consul" Version="18.0.0"/> |
|||
<PackageReference Update="Ocelot.Provider.Polly" Version="18.0.0"/> |
|||
|
|||
|
|||
<PackageReference Update="FreeSql" Version="3.2.682"/> |
|||
<PackageReference Update="FreeSql.Provider.MySql" Version="3.2.682"/> |
|||
<PackageReference Update="FreeSql.Provider.Sqlite" Version="3.2.682"/> |
|||
|
|||
<PackageReference Update="xunit" Version="2.4.1"/> |
|||
<PackageReference Update="xunit.extensibility.execution" Version="2.4.1"/> |
|||
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.5"/> |
|||
|
|||
<PackageReference Update="Hangfire.Redis.StackExchange" Version="1.8.5"/> |
|||
|
|||
<PackageReference Update="DotNetCore.CAP" Version="7.0.2"/> |
|||
<PackageReference Update="DotNetCore.CAP.Dashboard" Version="7.0.2"/> |
|||
<PackageReference Update="DotNetCore.CAP.Mysql" Version="7.0.2"/> |
|||
<PackageReference Update="DotNetCore.CAP.RabbitMQ" Version="7.0.2"/> |
|||
<PackageReference Update="DotNetCore.CAP.InMemoryStorage" Version="7.0.2"/> |
|||
<PackageReference Update="Savorboard.CAP.InMemoryMessageQueue" Version="7.0.0"/> |
|||
|
|||
<PackageReference Update="Swashbuckle.AspNetCore.SwaggerUI" Version="6.3.1"/> |
|||
<PackageReference Update="Swashbuckle.AspNetCore" Version="6.3.1"/> |
|||
<PackageReference Update="Swashbuckle.AspNetCore.Annotations" Version="6.3.1"/> |
|||
|
|||
<PackageReference Update="Serilog" Version="2.11.0"/> |
|||
<PackageReference Update="Serilog.Extensions.Logging" Version="3.1.0"/> |
|||
<PackageReference Update="Serilog.Sinks.Async" Version="1.5.0"/> |
|||
<PackageReference Update="Serilog.Sinks.File" Version="5.0.0"/> |
|||
<PackageReference Update="Serilog.Sinks.Console" Version="4.0.1"/> |
|||
<PackageReference Update="Serilog.AspNetCore" Version="5.0.0"/> |
|||
<PackageReference Update="Serilog.Exceptions" Version="8.2.0"/> |
|||
<PackageReference Update="Serilog.Settings.Configuration" Version="3.3.0"/> |
|||
<PackageReference Update="Serilog.Sinks.Elasticsearch" Version="8.4.1"/> |
|||
|
|||
<PackageReference Update="Magicodes.IE.Excel" Version="2.7.0"/> |
|||
<PackageReference Update="Magicodes.IE.Excel.AspNetCore" Version="2.7.0"/> |
|||
|
|||
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.2.22"/> |
|||
<PackageReference Update="MiniProfiler.EntityFrameworkCore" Version="4.2.22"/> |
|||
<PackageReference Update="MiniProfiler.Shared" Version="4.2.22"/> |
|||
|
|||
<PackageReference Update="AutoFixture.Xunit2" Version="4.17.0"/> |
|||
<PackageReference Update="prometheus-net.AspNetCore" Version="5.0.2"/> |
|||
<PackageReference Update="Aliyun.OSS.SDK.NetCore" Version="2.13.0"/> |
|||
|
|||
<PackageReference Update="Zack.EFCore.Batch.MySQL.Pomelo_NET6" Version="6.1.3"/> |
|||
<PackageReference Update="Zack.EFCore.Batch.Sqlite_NET6" Version="6.1.3"/> |
|||
|
|||
<PackageReference Update="Polly" Version="7.2.3"/> |
|||
<PackageReference Update="Confluent.Kafka" Version="1.8.2.0"/> |
|||
|
|||
|
|||
<!-- Idenity 一下三个包升级到最新版导致鉴权不通过--> |
|||
<PackageReference Update="Microsoft.IdentityModel.Tokens" Version="6.10.0"/> |
|||
<PackageReference Update="System.IdentityModel.Tokens.Jwt" Version="6.10.0"/> |
|||
<PackageReference Update="IdentityModel" Version="5.1.0"/> |
|||
</ItemGroup> |
|||
</Project> |
|||
@ -0,0 +1,140 @@ |
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Version 17 |
|||
VisualStudioVersion = 17.0.31410.414 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Domain", "src\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj", "{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Application", "src\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj", "{1A94A50E-06DC-43C1-80B5-B662820EC3EB}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.EntityFrameworkCore", "src\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj", "{C956DD76-69C8-4A9C-83EA-D17DF83340FD}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CA9AC87F-097E-4F15-8393-4BC07735A5B0}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{04DBDB01-70F4-4E06-B468-8F87850B22BE}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Application.Tests", "test\MyCompanyName.MyProjectName.Application.Tests\MyCompanyName.MyProjectName.Application.Tests.csproj", "{50B2631D-129C-47B3-A587-029CCD6099BC}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Domain.Shared", "src\MyCompanyName.MyProjectName.Domain.Shared\MyCompanyName.MyProjectName.Domain.Shared.csproj", "{42F719ED-8413-4895-B5B4-5AB56079BC66}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Application.Contracts", "src\MyCompanyName.MyProjectName.Application.Contracts\MyCompanyName.MyProjectName.Application.Contracts.csproj", "{520659C8-C734-4298-A3DA-B539DB9DFC0B}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.HttpApi", "src\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj", "{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.HttpApi.Client", "src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj", "{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.EntityFrameworkCore.Tests", "test\MyCompanyName.MyProjectName.EntityFrameworkCore.Tests\MyCompanyName.MyProjectName.EntityFrameworkCore.Tests.csproj", "{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.TestBase", "test\MyCompanyName.MyProjectName.TestBase\MyCompanyName.MyProjectName.TestBase.csproj", "{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.Domain.Tests", "test\MyCompanyName.MyProjectName.Domain.Tests\MyCompanyName.MyProjectName.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.DbMigrator", "src\MyCompanyName.MyProjectName.DbMigrator\MyCompanyName.MyProjectName.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0.Solution Items", "0.Solution Items", "{2C4A6DB8-8D9E-42E6-B7C3-1EDB7B3DE22E}" |
|||
ProjectSection(SolutionItems) = preProject |
|||
Directory.Build.Lion.targets = Directory.Build.Lion.targets |
|||
Directory.Build.Microsoft.targets = Directory.Build.Microsoft.targets |
|||
Directory.Build.targets = Directory.Build.targets |
|||
Directory.Build.Volo.targets = Directory.Build.Volo.targets |
|||
global.json = global.json |
|||
EndProjectSection |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{8C1B8C6C-C518-4290-B070-622CCA6004DA}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.HttpApi.Host", "host\MyCompanyName.MyProjectName.HttpApi.Host\MyCompanyName.MyProjectName.HttpApi.Host.csproj", "{FB20372D-6C96-4733-9AAC-12522F15CAA6}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MyCompanyName.MyProjectName.FreeSqlRepository", "src\MyCompanyName.MyProjectName.FreeSqlRepository\MyCompanyName.MyProjectName.FreeSqlRepository.csproj", "{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp", "test\MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp\MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp.csproj", "{A5E9AAA7-B3A2-44CC-83B8-7260057185E6}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{42F719ED-8413-4895-B5B4-5AB56079BC66}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{520659C8-C734-4298-A3DA-B539DB9DFC0B}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{FB20372D-6C96-4733-9AAC-12522F15CAA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{FB20372D-6C96-4733-9AAC-12522F15CAA6}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{FB20372D-6C96-4733-9AAC-12522F15CAA6}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{FB20372D-6C96-4733-9AAC-12522F15CAA6}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{A5E9AAA7-B3A2-44CC-83B8-7260057185E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{A5E9AAA7-B3A2-44CC-83B8-7260057185E6}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{A5E9AAA7-B3A2-44CC-83B8-7260057185E6}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{A5E9AAA7-B3A2-44CC-83B8-7260057185E6}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{554AD327-6DBA-4F8F-96F8-81CE7A0C863F} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{1A94A50E-06DC-43C1-80B5-B662820EC3EB} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{C956DD76-69C8-4A9C-83EA-D17DF83340FD} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{50B2631D-129C-47B3-A587-029CCD6099BC} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{42F719ED-8413-4895-B5B4-5AB56079BC66} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{520659C8-C734-4298-A3DA-B539DB9DFC0B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{4164BDF7-F527-4E85-9CE6-E3C2D7426A27} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{3B5A0094-670D-4BB1-BFDD-61B88A8773DC} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
{AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{FB20372D-6C96-4733-9AAC-12522F15CAA6} = {8C1B8C6C-C518-4290-B070-622CCA6004DA} |
|||
{27C7A0E6-4C2E-4AFF-9DE7-1F526DDC0D18} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} |
|||
{A5E9AAA7-B3A2-44CC-83B8-7260057185E6} = {04DBDB01-70F4-4E06-B468-8F87850B22BE} |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,7 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
|
|||
<configuration> |
|||
<packageSources> |
|||
<add key="nuget" value="https://api.nuget.org/v3/index.json" /> |
|||
</packageSources> |
|||
</configuration> |
|||
@ -0,0 +1,6 @@ |
|||
{ |
|||
"sdk": { |
|||
"version": "7.0.304", |
|||
"rollForward": "latestFeature" |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace MyCompanyName.MyProjectName.Controllers |
|||
{ |
|||
public class HomeController : AbpController |
|||
{ |
|||
public ActionResult Index() |
|||
{ |
|||
return Redirect("/Login"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 |
|||
|
|||
# 创建目录 |
|||
RUN mkdir /app |
|||
|
|||
COPY publish /app |
|||
|
|||
RUN echo "deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib" > /etc/apt/sources.list && \ |
|||
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib" >> /etc/apt/sources.list && \ |
|||
echo "deb http://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \ |
|||
echo "deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main" >> /etc/apt/sources.list && \ |
|||
echo "deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \ |
|||
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib" >> /etc/apt/sources.list && \ |
|||
echo "deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list && \ |
|||
echo "deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" >> /etc/apt/sources.list && \ |
|||
apt-get update && \ |
|||
apt-get install libgdiplus libc6-dev -y && \ |
|||
ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll && \ |
|||
ln -s /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/libdl.dll && apt-get clean |
|||
|
|||
# 设置工作目录 |
|||
WORKDIR /app |
|||
|
|||
# 暴露80端口 |
|||
EXPOSE 80 |
|||
# 设置时区 .net6 才有这个问题 |
|||
ENV TZ=Asia/Shanghai |
|||
|
|||
# 设置环境变量 |
|||
ENV ASPNETCORE_ENVIRONMENT=Production |
|||
|
|||
ENTRYPOINT ["dotnet", "MyCompanyName.MyProjectName.HttpApi.Host.dll"] |
|||
|
|||
|
|||
@ -0,0 +1,21 @@ |
|||
namespace MyCompanyName.MyProjectName.Extensions.Hangfire; |
|||
|
|||
public class AutoDeleteAfterSuccessAttributer : JobFilterAttribute, IApplyStateFilter |
|||
{ |
|||
private readonly TimeSpan _deleteAfter; |
|||
|
|||
public AutoDeleteAfterSuccessAttributer(TimeSpan timeSpan) |
|||
{ |
|||
_deleteAfter = timeSpan; |
|||
} |
|||
|
|||
public void OnStateApplied(ApplyStateContext context, IWriteOnlyTransaction transaction) |
|||
{ |
|||
context.JobExpirationTimeout = _deleteAfter; |
|||
} |
|||
|
|||
public void OnStateUnapplied(ApplyStateContext context, IWriteOnlyTransaction transaction) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
namespace MyCompanyName.MyProjectName.Extensions.Hangfire |
|||
{ |
|||
/// <summary>
|
|||
/// Cron类型
|
|||
/// </summary>
|
|||
public static class CronType |
|||
{ |
|||
/// <summary>
|
|||
/// 周期性为分钟的任务
|
|||
/// </summary>
|
|||
/// <param name="interval">执行周期的间隔,默认为每分钟一次</param>
|
|||
/// <returns></returns>
|
|||
public static string Minute(int interval = 1) |
|||
{ |
|||
return "1 0/" + interval.ToString() + " * * * ? "; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 周期性为小时的任务
|
|||
/// </summary>
|
|||
/// <param name="minute">第几分钟开始,默认为第一分钟</param>
|
|||
/// <param name="interval">执行周期的间隔,默认为每小时一次</param>
|
|||
/// <returns></returns>
|
|||
public static string Hour(int minute = 1, int interval = 1) |
|||
{ |
|||
return "1 " + minute + " 0/" + interval.ToString() + " * * ? "; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 周期性为天的任务
|
|||
/// </summary>
|
|||
/// <param name="hour">第几小时开始,默认从1点开始</param>
|
|||
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
|
|||
/// <param name="interval">执行周期的间隔,默认为每天一次</param>
|
|||
/// <returns></returns>
|
|||
public static string Day(int hour = 1, int minute = 1, int interval = 1) |
|||
{ |
|||
return "1 " + minute.ToString() + " " + hour.ToString() + " 1/" + interval.ToString() + " * ? "; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 周期性为周的任务
|
|||
/// </summary>
|
|||
/// <param name="dayOfWeek">星期几开始,默认从星期一点开始</param>
|
|||
/// <param name="hour">第几小时开始,默认从1点开始</param>
|
|||
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
|
|||
/// <returns></returns>
|
|||
public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 1, int minute = 1) |
|||
{ |
|||
return Cron.Weekly(dayOfWeek, hour, minute); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 周期性为月的任务
|
|||
/// </summary>
|
|||
/// <param name="day">几号开始,默认从一号开始</param>
|
|||
/// <param name="hour">第几小时开始,默认从1点开始</param>
|
|||
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
|
|||
/// <returns></returns>
|
|||
public static string Month(int day = 1, int hour = 1, int minute = 1) |
|||
{ |
|||
return Cron.Monthly(day, hour, minute); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 周期性为年的任务
|
|||
/// </summary>
|
|||
/// <param name="month">几月开始,默认从一月开始</param>
|
|||
/// <param name="day">几号开始,默认从一号开始</param>
|
|||
/// <param name="hour">第几小时开始,默认从1点开始</param>
|
|||
/// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
|
|||
/// <returns></returns>
|
|||
public static string Year(int month = 1, int day = 1, int hour = 1, int minute = 1) |
|||
{ |
|||
return Cron.Yearly(month, day, hour, minute); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
namespace MyCompanyName.MyProjectName.Extensions.Hangfire |
|||
{ |
|||
public class CustomHangfireAuthorizeFilter : IDashboardAuthorizationFilter |
|||
{ |
|||
public bool Authorize(DashboardContext context) |
|||
{ |
|||
var _currentUser = context.GetHttpContext().RequestServices.GetRequiredService<ICurrentUser>(); |
|||
return _currentUser.IsAuthenticated; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
namespace MyCompanyName.MyProjectName.Extensions.Hangfire; |
|||
|
|||
/// <summary>
|
|||
/// 重试最后一次
|
|||
/// </summary>
|
|||
public class JobRetryLastFilter : JobFilterAttribute, IElectStateFilter |
|||
{ |
|||
private int RetryCount { get; } |
|||
|
|||
public JobRetryLastFilter(int retryCount) |
|||
{ |
|||
RetryCount = retryCount; |
|||
} |
|||
|
|||
|
|||
public void OnStateElection(ElectStateContext context) |
|||
{ |
|||
var retryAttempt = context.GetJobParameter<int>("RetryCount"); |
|||
if (RetryCount == retryAttempt) |
|||
{ |
|||
Log.Error("最后一次重试"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using MyCompanyName.MyProjectName.Jobs; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Extensions |
|||
{ |
|||
public static class RecurringJobsExtensions |
|||
{ |
|||
public static void CreateRecurringJob(this ApplicationInitializationContext context) |
|||
{ |
|||
using var scope = context.ServiceProvider.CreateScope(); |
|||
var testJob = scope.ServiceProvider.GetService<TestJob>(); |
|||
RecurringJob.AddOrUpdate("测试Job", () => testJob.ExecuteAsync(), CronType.Minute(1), TimeZoneInfo.Local); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
namespace Microsoft.AspNetCore.Builder; |
|||
|
|||
public static class MyProjectNameApplicationBuilderExtensionsExtensions |
|||
{ |
|||
/// <summary>
|
|||
/// 记录请求响应日志
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
public static IApplicationBuilder UseRequestLog(this IApplicationBuilder app) |
|||
{ |
|||
return app.UseMiddleware<RequestLogMiddleware>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
namespace MyCompanyName.MyProjectName.Extensions.Middlewares; |
|||
|
|||
public class RequestLogMiddleware |
|||
{ |
|||
private readonly RequestDelegate _next; |
|||
private readonly ILogger<RequestLogMiddleware> _logger; |
|||
|
|||
public RequestLogMiddleware(RequestDelegate next, |
|||
ILogger<RequestLogMiddleware> logger) |
|||
{ |
|||
_next = next; |
|||
_logger = logger; |
|||
} |
|||
|
|||
public async Task InvokeAsync(HttpContext context) |
|||
{ |
|||
context.Request.EnableBuffering(); |
|||
var originalBody = context.Response.Body; |
|||
if (context.Request.Path.ToString().ToLower().Contains("swagger") |
|||
|| context.Request.Path.ToString().ToLower().Contains("login") |
|||
|| context.Request.Path.ToString().ToLower().Contains("monitor") |
|||
|| context.Request.Path.ToString().ToLower().Contains("cap") |
|||
|| context.Request.Path.ToString().ToLower().Contains("hangfire") |
|||
|| context.Request.Path.ToString() == "/" |
|||
) |
|||
{ |
|||
await _next(context); |
|||
} |
|||
else |
|||
{ |
|||
try |
|||
{ |
|||
var logRequestId = Guid.NewGuid().ToString(); |
|||
await RequestDataLog(context, logRequestId); |
|||
using (var ms = new MemoryStream()) |
|||
{ |
|||
context.Response.Body = ms; |
|||
await _next(context); |
|||
ResponseDataLog(ms, logRequestId); |
|||
ms.Position = 0; |
|||
await ms.CopyToAsync(originalBody); |
|||
} |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
// 记录异常
|
|||
_logger.LogError(ex.Message + "" + ex.InnerException); |
|||
} |
|||
finally |
|||
{ |
|||
context.Response.Body = originalBody; |
|||
} |
|||
} |
|||
} |
|||
|
|||
private async Task RequestDataLog(HttpContext context, |
|||
string requestId) |
|||
{ |
|||
var request = context.Request; |
|||
var body = new StreamReader(request.Body); |
|||
var requestData = $" 请求路径:{request.Path}\r\n 请求Body参数:{await body.ReadToEndAsync()}"; |
|||
_logger.LogInformation($"日志中间件[Request],LogRequestId:{requestId}:请求接口信息:{requestData}"); |
|||
request.Body.Position = 0; |
|||
} |
|||
|
|||
private void ResponseDataLog(MemoryStream ms, string requestId) |
|||
{ |
|||
ms.Position = 0; |
|||
var responseBody = new StreamReader(ms).ReadToEnd(); |
|||
// 去除 Html
|
|||
var isHtml = Regex.IsMatch(responseBody, "<[^>]+>"); |
|||
if (!isHtml && !string.IsNullOrEmpty(responseBody)) |
|||
{ |
|||
_logger.LogInformation($"日志中间件[Response],LogRequestId:{requestId}:响应接口信息:{responseBody}"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.Collections.Generic; |
|||
global using System.IO; |
|||
global using System.Linq; |
|||
global using System.Text; |
|||
global using System.Text.RegularExpressions; |
|||
global using System.Threading.Tasks; |
|||
global using Hangfire; |
|||
global using Hangfire.Common; |
|||
global using Hangfire.Dashboard; |
|||
global using Hangfire.States; |
|||
global using Hangfire.Storage; |
|||
global using Lion.AbpPro; |
|||
global using MyCompanyName.MyProjectName.EntityFrameworkCore; |
|||
global using MyCompanyName.MyProjectName.Extensions; |
|||
global using MyCompanyName.MyProjectName.Extensions.Hangfire; |
|||
global using MyCompanyName.MyProjectName.Extensions.Middlewares; |
|||
global using MyCompanyName.MyProjectName.MultiTenancy; |
|||
global using Microsoft.AspNetCore.Authentication.JwtBearer; |
|||
global using Microsoft.AspNetCore.Builder; |
|||
global using Microsoft.AspNetCore.DataProtection; |
|||
global using Microsoft.AspNetCore.Hosting; |
|||
global using Microsoft.AspNetCore.Http; |
|||
global using Microsoft.AspNetCore.Identity; |
|||
global using Microsoft.AspNetCore.Mvc; |
|||
global using Microsoft.AspNetCore.Mvc.Abstractions; |
|||
global using Microsoft.AspNetCore.Mvc.Filters; |
|||
global using Microsoft.Extensions.Configuration; |
|||
global using Microsoft.Extensions.DependencyInjection; |
|||
global using Microsoft.Extensions.Hosting; |
|||
global using Microsoft.Extensions.Localization; |
|||
global using Microsoft.Extensions.Logging; |
|||
global using Microsoft.Extensions.Logging.Abstractions; |
|||
global using Microsoft.Extensions.Options; |
|||
global using Microsoft.IdentityModel.Tokens; |
|||
global using Microsoft.OpenApi.Models; |
|||
global using Serilog; |
|||
global using StackExchange.Redis; |
|||
global using Swagger; |
|||
global using Swashbuckle.AspNetCore.SwaggerUI; |
|||
global using Volo.Abp; |
|||
global using Volo.Abp.Account.Web; |
|||
global using Volo.Abp.AspNetCore.Auditing; |
|||
global using Volo.Abp.AspNetCore.Authentication.JwtBearer; |
|||
global using Volo.Abp.AspNetCore.ExceptionHandling; |
|||
global using Volo.Abp.AspNetCore.Mvc; |
|||
global using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; |
|||
global using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; |
|||
global using Volo.Abp.AspNetCore.Serilog; |
|||
global using Volo.Abp.Auditing; |
|||
global using Volo.Abp.Authorization; |
|||
global using Volo.Abp.BackgroundJobs; |
|||
global using Volo.Abp.BackgroundJobs.Hangfire; |
|||
global using Volo.Abp.Caching; |
|||
global using Volo.Abp.Caching.StackExchangeRedis; |
|||
global using Volo.Abp.DependencyInjection; |
|||
global using Volo.Abp.Domain.Entities; |
|||
global using Volo.Abp.ExceptionHandling; |
|||
global using Volo.Abp.Http; |
|||
global using Volo.Abp.Json; |
|||
global using Volo.Abp.Modularity; |
|||
global using Volo.Abp.Users; |
|||
global using Volo.Abp.Validation; |
|||
@ -0,0 +1,59 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace> |
|||
<PreserveCompilationReferences>true</PreserveCompilationReferences> |
|||
<UserSecretsId>MyCompanyName.MyProjectName-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
|
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" /> |
|||
<PackageReference Include="Volo.Abp.Account.Web" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" /> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> |
|||
<PackageReference Include="Volo.Abp.Swashbuckle" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" /> |
|||
<PackageReference Include="Serilog" /> |
|||
<PackageReference Include="Serilog.AspNetCore" /> |
|||
<PackageReference Include="Serilog.Exceptions" /> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Settings.Configuration" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Serilog.Sinks.Elasticsearch" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
<PackageReference Include="Serilog.Sinks.Async" /> |
|||
<PackageReference Include="Hangfire.Redis.StackExchange" /> |
|||
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" /> |
|||
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" /> |
|||
<PackageReference Include="DotNetCore.CAP.MySql" /> |
|||
<PackageReference Include="DotNetCore.CAP.RabbitMQ" /> |
|||
<PackageReference Include="DotNetCore.CAP.Dashboard" /> |
|||
<PackageReference Include="DotNetCore.CAP.InMemoryStorage" /> |
|||
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" /> |
|||
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" /> |
|||
<PackageReference Include="MiniProfiler.EntityFrameworkCore" /> |
|||
<PackageReference Include="MiniProfiler.Shared" /> |
|||
<PackageReference Include="Lion.AbpPro.Shared.Hosting.Microservices" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" /> |
|||
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" /> |
|||
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,40 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
public static class MyProjectNameHttpApiHostConst |
|||
{ |
|||
/// <summary>
|
|||
/// 跨域策略名
|
|||
/// </summary>
|
|||
public const string DefaultCorsPolicyName = "Default"; |
|||
|
|||
/// <summary>
|
|||
/// Cookies名称
|
|||
/// </summary>
|
|||
public const string DefaultCookieName = "MyCompanyName.MyProjectName.Http.Api"; |
|||
|
|||
/// <summary>
|
|||
/// SwaggerUi 端点
|
|||
/// </summary>
|
|||
public const string SwaggerUiEndPoint = "/swagger"; |
|||
|
|||
/// <summary>
|
|||
/// Hangfire 端点
|
|||
/// </summary>
|
|||
public const string HangfireDashboardEndPoint = "/hangfire"; |
|||
|
|||
/// <summary>
|
|||
/// CAP 端点
|
|||
/// </summary>
|
|||
public const string CapDashboardEndPoint = "/cap"; |
|||
|
|||
|
|||
public const string MoreEndPoint = "https://doc.cncore.club/"; |
|||
|
|||
|
|||
/// <summary>
|
|||
/// HMiniprofiler端点
|
|||
/// </summary>
|
|||
public const string MiniprofilerEndPoint = "/profiler/results-index"; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,268 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
[DependsOn( |
|||
typeof(MyProjectNameHttpApiModule), |
|||
typeof(SharedHostingMicroserviceModule), |
|||
typeof(AbpAspNetCoreMvcUiMultiTenancyModule), |
|||
typeof(MyProjectNameEntityFrameworkCoreModule), |
|||
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), |
|||
typeof(AbpAspNetCoreSerilogModule), |
|||
typeof(AbpAccountWebModule), |
|||
typeof(MyProjectNameApplicationModule), |
|||
typeof(AbpAspNetCoreMvcUiBasicThemeModule), |
|||
typeof(AbpCachingStackExchangeRedisModule) |
|||
)] |
|||
public class MyProjectNameHttpApiHostModule : AbpModule |
|||
{ |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var configuration = context.Services.GetConfiguration(); |
|||
ConfigureCache(context); |
|||
ConfigureSwaggerServices(context); |
|||
ConfigureJwtAuthentication(context, configuration); |
|||
ConfigureMiniProfiler(context); |
|||
ConfigureIdentity(context); |
|||
ConfigureAuditLog(context); |
|||
ConfigurationSignalR(context); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
var app = context.GetApplicationBuilder(); |
|||
app.UseAbpRequestLocalization(); |
|||
app.UseCorrelationId(); |
|||
app.UseStaticFiles(); |
|||
app.UseMiniProfiler(); |
|||
app.UseRouting(); |
|||
app.UseCors(MyProjectNameHttpApiHostConst.DefaultCorsPolicyName); |
|||
app.UseAuthentication(); |
|||
|
|||
if (MultiTenancyConsts.IsEnabled) |
|||
{ |
|||
app.UseMultiTenancy(); |
|||
} |
|||
|
|||
app.UseAuthorization(); |
|||
app.UseSwagger(); |
|||
app.UseAbpSwaggerUI(options => |
|||
{ |
|||
options.SwaggerEndpoint("/swagger/MyProjectName/swagger.json", "MyProjectName API"); |
|||
options.DocExpansion(DocExpansion.None); |
|||
options.DefaultModelsExpandDepth(-1); |
|||
}); |
|||
|
|||
app.UseAuditing(); |
|||
app.UseAbpSerilogEnrichers(); |
|||
|
|||
app.UseUnitOfWork(); |
|||
app.UseConfiguredEndpoints(endpoints => { endpoints.MapHealthChecks("/health"); }); |
|||
|
|||
} |
|||
private void ConfigurationSignalR(ServiceConfigurationContext context) |
|||
{ |
|||
var redisConnection = context.Services.GetConfiguration()["Redis:Configuration"]; |
|||
|
|||
if (redisConnection.IsNullOrWhiteSpace()) |
|||
{ |
|||
throw new UserFriendlyException(message: "Redis连接字符串未配置."); |
|||
} |
|||
|
|||
context.Services.AddSignalR().AddStackExchangeRedis(redisConnection, options => { options.Configuration.ChannelPrefix = "Lion.AbpPro"; }); |
|||
} |
|||
/// <summary>
|
|||
/// 配置MiniProfiler
|
|||
/// </summary>
|
|||
private void ConfigureMiniProfiler(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddMiniProfiler(options => options.RouteBasePath = "/profiler").AddEntityFramework(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 配置JWT
|
|||
/// </summary>
|
|||
private void ConfigureJwtAuthentication(ServiceConfigurationContext context, IConfiguration configuration) |
|||
{ |
|||
context.Services.AddAuthentication(options => |
|||
{ |
|||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; |
|||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; |
|||
}) |
|||
.AddJwtBearer(options => |
|||
{ |
|||
options.TokenValidationParameters = |
|||
new TokenValidationParameters() |
|||
{ |
|||
// 是否开启签名认证
|
|||
ValidateIssuerSigningKey = true, |
|||
ValidateIssuer = true, |
|||
ValidateAudience = true, |
|||
ValidateLifetime = true, |
|||
//ClockSkew = TimeSpan.Zero,
|
|||
ValidIssuer = configuration["Jwt:Issuer"], |
|||
ValidAudience = configuration["Jwt:Audience"], |
|||
IssuerSigningKey = |
|||
new SymmetricSecurityKey( |
|||
Encoding.ASCII.GetBytes(configuration["Jwt:SecurityKey"])) |
|||
}; |
|||
|
|||
options.Events = new JwtBearerEvents |
|||
{ |
|||
OnMessageReceived = currentContext => |
|||
{ |
|||
var path = currentContext.HttpContext.Request.Path; |
|||
if (path.StartsWithSegments("/login")) |
|||
{ |
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
var accessToken = string.Empty; |
|||
if (currentContext.HttpContext.Request.Headers.ContainsKey("Authorization")) |
|||
{ |
|||
accessToken = currentContext.HttpContext.Request.Headers["Authorization"]; |
|||
if (!string.IsNullOrWhiteSpace(accessToken)) |
|||
{ |
|||
accessToken = accessToken.Split(" ").LastOrDefault(); |
|||
} |
|||
} |
|||
|
|||
if (accessToken.IsNullOrWhiteSpace()) |
|||
{ |
|||
accessToken = currentContext.Request.Query["access_token"].FirstOrDefault(); |
|||
} |
|||
|
|||
if (accessToken.IsNullOrWhiteSpace()) |
|||
{ |
|||
accessToken = currentContext.Request.Cookies[MyProjectNameHttpApiHostConst.DefaultCookieName]; |
|||
} |
|||
|
|||
currentContext.Token = accessToken; |
|||
currentContext.Request.Headers.Remove("Authorization"); |
|||
currentContext.Request.Headers.Add("Authorization", $"Bearer {accessToken}"); |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
}; |
|||
}); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// Redis缓存
|
|||
/// </summary>
|
|||
private void ConfigureCache(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpDistributedCacheOptions>( |
|||
options => { options.KeyPrefix = "MyProjectName:"; }); |
|||
var configuration = context.Services.GetConfiguration(); |
|||
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); |
|||
context.Services |
|||
.AddDataProtection() |
|||
.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys"); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 配置Identity
|
|||
/// </summary>
|
|||
private void ConfigureIdentity(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.Configure<IdentityOptions>(options => { options.Lockout = new LockoutOptions() { AllowedForNewUsers = false }; }); |
|||
} |
|||
|
|||
private static void ConfigureSwaggerServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddSwaggerGen( |
|||
options => |
|||
{ |
|||
// 文件下载类型
|
|||
options.MapType<FileContentResult>(() => new OpenApiSchema() { Type = "file" }); |
|||
|
|||
options.SwaggerDoc("MyProjectName", |
|||
new OpenApiInfo { Title = "MyCompanyNameMyProjectName API", Version = "v1" }); |
|||
options.DocInclusionPredicate((docName, description) => true); |
|||
options.EnableAnnotations(); // 启用注解
|
|||
options.DocumentFilter<HiddenAbpDefaultApiFilter>(); |
|||
options.SchemaFilter<EnumSchemaFilter>(); |
|||
// 加载所有xml注释,这里会导致swagger加载有点缓慢
|
|||
var xmlPaths = Directory.GetFiles(AppContext.BaseDirectory, "*.xml"); |
|||
foreach (var xml in xmlPaths) |
|||
{ |
|||
options.IncludeXmlComments(xml, true); |
|||
} |
|||
|
|||
options.AddSecurityDefinition(JwtBearerDefaults.AuthenticationScheme, |
|||
new OpenApiSecurityScheme() |
|||
{ |
|||
Description = "直接在下框输入JWT生成的Token", |
|||
Name = "Authorization", |
|||
In = ParameterLocation.Header, |
|||
Type = SecuritySchemeType.Http, |
|||
Scheme = JwtBearerDefaults.AuthenticationScheme, |
|||
BearerFormat = "JWT" |
|||
}); |
|||
options.AddSecurityRequirement(new OpenApiSecurityRequirement |
|||
{ |
|||
{ |
|||
new OpenApiSecurityScheme |
|||
{ |
|||
Reference = new OpenApiReference |
|||
{ |
|||
Type = ReferenceType.SecurityScheme, Id = "Bearer" |
|||
} |
|||
}, |
|||
new List<string>() |
|||
} |
|||
}); |
|||
|
|||
options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme() |
|||
{ |
|||
Type = SecuritySchemeType.ApiKey, |
|||
In = ParameterLocation.Header, |
|||
Name = "Accept-Language", |
|||
Description = "多语言设置,系统预设语言有zh-Hans、en,默认为zh-Hans", |
|||
}); |
|||
|
|||
options.AddSecurityRequirement(new OpenApiSecurityRequirement |
|||
{ |
|||
{ |
|||
new OpenApiSecurityScheme |
|||
{ |
|||
Reference = new OpenApiReference |
|||
{ Type = ReferenceType.SecurityScheme, Id = "ApiKey" } |
|||
}, |
|||
Array.Empty<string>() |
|||
} |
|||
}); |
|||
}); |
|||
} |
|||
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 审计日志
|
|||
/// </summary>
|
|||
private void ConfigureAuditLog(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpAuditingOptions> |
|||
( |
|||
options => |
|||
{ |
|||
options.IsEnabled = true; |
|||
options.EntityHistorySelectors.AddAllEntities(); |
|||
options.ApplicationName = "MyCompanyName.MyProjectName"; |
|||
} |
|||
); |
|||
|
|||
Configure<AbpAspNetCoreAuditingOptions>( |
|||
options => |
|||
{ |
|||
options.IgnoredUrls.Add("/AuditLogs/page"); |
|||
options.IgnoredUrls.Add("/hangfire/stats"); |
|||
options.IgnoredUrls.Add("/cap"); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,161 @@ |
|||
@page |
|||
@model MyCompanyName.MyProjectName.Pages.Login |
|||
|
|||
@{ |
|||
Layout = null; |
|||
} |
|||
|
|||
<!DOCTYPE html> |
|||
|
|||
<html> |
|||
<head> |
|||
<title>后台服务登录</title> |
|||
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> |
|||
<link href="https://cdn.staticfile.org/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"> |
|||
</head> |
|||
<body> |
|||
<div class="container"> |
|||
<div class="row"> |
|||
<div class="col-md-offset-3 col-md-6"> |
|||
<form class="form-horizontal" method="post"> |
|||
@Html.AntiForgeryToken() |
|||
<span class="heading">后台服务登录</span> |
|||
<div class="form-group"> |
|||
<input type="text" class="form-control" name="userName" placeholder="用户名"> |
|||
<i class="fa fa-user"></i> |
|||
</div> |
|||
<div class="form-group help"> |
|||
<input type="password" class="form-control" name="password" placeholder="密码"> |
|||
<i class="fa fa-lock"></i> |
|||
</div> |
|||
<div class="form-group"> |
|||
<button type="submit" class="btn btn-default">登录</button> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
|||
<style> |
|||
.row { |
|||
width: 800 px; |
|||
height: auto; |
|||
margin: auto; |
|||
box-sizing: border-box; |
|||
transform: translate(0, 50%); |
|||
} |
|||
.form-horizontal { |
|||
background: #fff; |
|||
padding-bottom: 40px; |
|||
border-radius: 15px; |
|||
text-align: center; |
|||
} |
|||
.form-horizontal .heading { |
|||
display: block; |
|||
font-size: 35px; |
|||
font-weight: 700; |
|||
padding: 35px 0; |
|||
border-bottom: 1px solid #f0f0f0; |
|||
margin-bottom: 30px; |
|||
} |
|||
.form-horizontal .form-group { |
|||
padding: 0 40px; |
|||
margin: 0 0 25px 0; |
|||
position: relative; |
|||
} |
|||
.form-horizontal .form-control { |
|||
background: #f0f0f0; |
|||
border: none; |
|||
border-radius: 20px; |
|||
box-shadow: none; |
|||
padding: 0 20px 0 45px; |
|||
height: 40px; |
|||
transition: all 0.3s ease 0s; |
|||
} |
|||
.form-horizontal .form-control:focus { |
|||
background: #e0e0e0; |
|||
box-shadow: none; |
|||
outline: 0 none; |
|||
} |
|||
.form-horizontal .form-group i { |
|||
position: absolute; |
|||
top: 12px; |
|||
left: 60px; |
|||
font-size: 17px; |
|||
color: #c8c8c8; |
|||
transition: all 0.5s ease 0s; |
|||
} |
|||
.form-horizontal .form-control:focus + i { |
|||
color: #00b4ef; |
|||
} |
|||
.form-horizontal .fa-question-circle { |
|||
display: inline-block; |
|||
position: absolute; |
|||
top: 12px; |
|||
right: 60px; |
|||
font-size: 20px; |
|||
color: #808080; |
|||
transition: all 0.5s ease 0s; |
|||
} |
|||
.form-horizontal .fa-question-circle:hover { |
|||
color: #000; |
|||
} |
|||
.form-horizontal .main-checkbox { |
|||
float: left; |
|||
width: 20px; |
|||
height: 20px; |
|||
background: #11a3fc; |
|||
border-radius: 50%; |
|||
position: relative; |
|||
margin: 5px 0 0 5px; |
|||
border: 1px solid #11a3fc; |
|||
} |
|||
.form-horizontal .main-checkbox label { |
|||
width: 20px; |
|||
height: 20px; |
|||
position: absolute; |
|||
top: 0; |
|||
left: 0; |
|||
cursor: pointer; |
|||
} |
|||
.form-horizontal .main-checkbox label:after { |
|||
content: ""; |
|||
width: 10px; |
|||
height: 5px; |
|||
position: absolute; |
|||
top: 5px; |
|||
left: 4px; |
|||
border: 3px solid #fff; |
|||
border-top: none; |
|||
border-right: none; |
|||
background: transparent; |
|||
opacity: 0; |
|||
-webkit-transform: rotate(-45deg); |
|||
transform: rotate(-45deg); |
|||
} |
|||
.form-horizontal .main-checkbox input[type="checkbox"] { |
|||
visibility: hidden; |
|||
} |
|||
.form-horizontal .main-checkbox input[type="checkbox"]:checked + label:after { |
|||
opacity: 1; |
|||
} |
|||
.form-horizontal .text { |
|||
float: left; |
|||
margin-left: 7px; |
|||
line-height: 20px; |
|||
padding-top: 5px; |
|||
text-transform: capitalize; |
|||
} |
|||
.form-horizontal .btn { |
|||
text-align: center; |
|||
font-size: 14px; |
|||
color: #fff; |
|||
background: #00b4ef; |
|||
border-radius: 30px; |
|||
padding: 10px 25px; |
|||
border: none; |
|||
text-transform: capitalize; |
|||
transition: all 0.5s ease 0s; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,69 @@ |
|||
|
|||
using Lion.AbpPro.BasicManagement.ConfigurationOptions; |
|||
using Lion.AbpPro.BasicManagement.Users; |
|||
using Lion.AbpPro.BasicManagement.Users.Dtos; |
|||
using Microsoft.AspNetCore.Mvc.RazorPages; |
|||
|
|||
|
|||
namespace MyCompanyName.MyProjectName.Pages |
|||
{ |
|||
public class Login : PageModel |
|||
{ |
|||
private readonly IAccountAppService _accountAppService; |
|||
private readonly ILogger<Login> _logger; |
|||
private readonly IHostEnvironment _hostEnvironment; |
|||
private readonly JwtOptions _jwtOptions; |
|||
public Login(IAccountAppService accountAppService, |
|||
ILogger<Login> logger, |
|||
IHostEnvironment hostEnvironment, |
|||
IOptionsSnapshot<JwtOptions> jwtOptions) |
|||
{ |
|||
_accountAppService = accountAppService; |
|||
_logger = logger; |
|||
_hostEnvironment = hostEnvironment; |
|||
_jwtOptions = jwtOptions.Value; |
|||
} |
|||
|
|||
public void OnGet() |
|||
{ |
|||
} |
|||
|
|||
public async Task OnPost() |
|||
{ |
|||
string userName = Request.Form["userName"]; |
|||
string password = Request.Form["password"]; |
|||
if (userName.IsNullOrWhiteSpace() || password.IsNullOrWhiteSpace()) |
|||
{ |
|||
Response.Redirect("/Login"); |
|||
return; |
|||
} |
|||
|
|||
try |
|||
{ |
|||
var options = new CookieOptions |
|||
{ |
|||
Expires = DateTime.Now.AddHours(_jwtOptions.ExpirationTime), |
|||
SameSite = SameSiteMode.Unspecified, |
|||
}; |
|||
|
|||
|
|||
// 设置cookies domain
|
|||
//options.Domain = "MyProjectName.cn";
|
|||
|
|||
|
|||
var result = await _accountAppService.LoginAsync(new LoginInput() |
|||
{ Name = userName, Password = password }); |
|||
Response.Cookies.Append(MyProjectNameHttpApiHostConst.DefaultCookieName, |
|||
result.Token, options); |
|||
} |
|||
catch (Exception e) |
|||
{ |
|||
_logger.LogError($"登录失败:{e.Message}"); |
|||
Response.Redirect("/Login"); |
|||
return; |
|||
} |
|||
|
|||
Response.Redirect("/monitor"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,171 @@ |
|||
@page |
|||
@using MyCompanyName.MyProjectName |
|||
@model MyCompanyName.MyProjectName.Pages.Monitor |
|||
|
|||
|
|||
@{ |
|||
Layout = null; |
|||
} |
|||
|
|||
<!DOCTYPE html> |
|||
|
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"/> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> |
|||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet"/> |
|||
<title>后端服务</title> |
|||
</head> |
|||
|
|||
<body> |
|||
<div class="container projects"> |
|||
<div class="projects-header page-header"> |
|||
<h2>后端服务列表</h2> |
|||
@* <p>这些项目或者是对Bootstrap进行了有益的补充,或者是基于Bootstrap开发的</p> *@ |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-6 col-md-4 col-lg-3"> |
|||
<div class="thumbnail" style="height: 180px"> |
|||
<a href="@MyProjectNameHttpApiHostConst.SwaggerUiEndPoint" target="_blank"> |
|||
<img class="lazy" src="/images/swagger.png" width="300" height="150"/> |
|||
</a> |
|||
<div class="caption"> |
|||
<h3> |
|||
<a href="@MyProjectNameHttpApiHostConst.SwaggerUiEndPoint" target="_blank">SwaggerUI</a> |
|||
</h3> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
@* <div class="col-sm-6 col-md-4 col-lg-3"> *@ |
|||
@* <div class="thumbnail" style="height: 180px"> *@ |
|||
@* <a href="@MyProjectNameHttpApiHostConst.HangfireDashboardEndPoint" target="_blank"> *@ |
|||
@* <img class="lazy" src="/images/hangfire.png" width="300" height="150"/> *@ |
|||
@* </a> *@ |
|||
@* <div class="caption"> *@ |
|||
@* <h3> *@ |
|||
@* <a href="@MyProjectNameHttpApiHostConst.HangfireDashboardEndPoint" target="_blank">Hangfire面板</a> *@ |
|||
@* </h3> *@ |
|||
@* </div> *@ |
|||
@* </div> *@ |
|||
@* </div> *@ |
|||
<div class="col-sm-6 col-md-4 col-lg-3"> |
|||
<div class="thumbnail" style="height: 180px"> |
|||
<a href="@MyProjectNameHttpApiHostConst.MiniprofilerEndPoint" target="_blank"> |
|||
<img class="lazy" src="/images/miniprofiler.png" width="300" height="150"/> |
|||
</a> |
|||
<div class="caption"> |
|||
<h3> |
|||
<a href="@MyProjectNameHttpApiHostConst.MiniprofilerEndPoint" target="_blank">Miniprofiler</a> |
|||
</h3> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-sm-6 col-md-4 col-lg-3"> |
|||
<div class="thumbnail" style="height: 180px"> |
|||
<a href="@MyProjectNameHttpApiHostConst.MoreEndPoint" target="_blank"> |
|||
<img class="lazy" src="/images/more.png" width="300" height="150"/> |
|||
</a> |
|||
<div class="caption"> |
|||
<h3> |
|||
<a href="@MyProjectNameHttpApiHostConst.MoreEndPoint" target="_blank">了解更多...</a> |
|||
</h3> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</body> |
|||
</html> |
|||
<style> |
|||
*:before, |
|||
*:after { |
|||
-webkit-box-sizing: border-box; |
|||
-moz-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
} |
|||
.container { |
|||
width: 1170 px; |
|||
padding-right: 15 px; |
|||
padding-left: 15 px; |
|||
margin-right: auto; |
|||
margin-left: auto; |
|||
} |
|||
.projects-header { |
|||
width: 60%; |
|||
text-align: center; |
|||
font-weight: 200; |
|||
display: block; |
|||
margin: 60 px auto 40 px !important; |
|||
} |
|||
.page-header { |
|||
padding-bottom: 9px; |
|||
margin: 40px auto; |
|||
border-bottom: 1 px solid #eee; |
|||
} |
|||
.projects-header h2 { |
|||
font-size: 42px; |
|||
letter-spacing: -1px; |
|||
} |
|||
h2 { |
|||
margin-top: 20 px; |
|||
margin-bottom: 10 px; |
|||
font-weight: 500; |
|||
line-height: 1.1; |
|||
color: inherit; |
|||
/* text-align: center; */ |
|||
} |
|||
p { |
|||
margin: 0 0 10 px; |
|||
} |
|||
.row { |
|||
margin-right: -15 px; |
|||
margin-left: -15 px; |
|||
} |
|||
.col-lg-3 { |
|||
width: 25%; |
|||
} |
|||
.projects .thumbnail { |
|||
display: block; |
|||
margin-right: auto; |
|||
margin-left: auto; |
|||
text-align: center; |
|||
margin-bottom: 30 px; |
|||
border-radius: 0; |
|||
} |
|||
.thumbnail { |
|||
display: block; |
|||
padding: 4px; |
|||
line-height: 1.42857143; |
|||
background-color: #fff; |
|||
border: 1 px solid #ddd; |
|||
.transition(border 0.2s ease-in-out); |
|||
} |
|||
a { |
|||
color: #337ab7; |
|||
text-decoration: none; |
|||
background-color: transparent; |
|||
} |
|||
.projects .thumbnail img { |
|||
max-width: 100%; |
|||
height: auto; |
|||
} |
|||
.thumbnail a > img, |
|||
.thumbnail > img { |
|||
margin-right: auto; |
|||
margin-left: auto; |
|||
} |
|||
img { |
|||
vertical-align: middle; |
|||
} |
|||
/* .projects .thumbnail .caption { |
|||
overflow-y: hidden; |
|||
color: #555; |
|||
} */ |
|||
.caption { |
|||
padding: 9px; |
|||
overflow-y: hidden; |
|||
color: #555; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,12 @@ |
|||
using Microsoft.AspNetCore.Mvc.RazorPages; |
|||
|
|||
namespace MyCompanyName.MyProjectName.Pages |
|||
{ |
|||
public class Monitor : PageModel |
|||
{ |
|||
public void OnGet() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static void Main(string[] args) |
|||
{ |
|||
CreateHostBuilder(args).Build().Run(); |
|||
|
|||
} |
|||
|
|||
private static IHostBuilder CreateHostBuilder(string[] args) => |
|||
Host.CreateDefaultBuilder(args) |
|||
.ConfigureWebHostDefaults(webBuilder => |
|||
{ |
|||
webBuilder.ConfigureKestrel((context, options) => { options.Limits.MaxRequestBodySize = 1024 * 50; }); |
|||
webBuilder.UseStartup<Startup>(); |
|||
}) |
|||
.UseSerilog((context, loggerConfiguration) => |
|||
{ |
|||
SerilogToEsExtensions.SetSerilogConfiguration( |
|||
loggerConfiguration, |
|||
context.Configuration); |
|||
}).UseAutofac(); |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
{ |
|||
"profiles": { |
|||
"MyCompanyName.MyProjectName.HttpApi.Host": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"applicationUrl": "http://localhost:44315", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
public class Startup |
|||
{ |
|||
public void ConfigureServices(IServiceCollection services) |
|||
{ |
|||
services.AddApplication<MyProjectNameHttpApiHostModule>(); |
|||
} |
|||
|
|||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) |
|||
{ |
|||
app.InitializeApplication(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
{ |
|||
"Serilog": { |
|||
"Using": [ |
|||
"Serilog.Sinks.Console", |
|||
"Serilog.Sinks.File" |
|||
], |
|||
"MinimumLevel": { |
|||
"Default": "Debug", |
|||
"Override": { |
|||
"Microsoft": "Information", |
|||
"Volo.Abp": "Information", |
|||
"Hangfire": "Information", |
|||
"DotNetCore.CAP": "Information", |
|||
"Serilog.AspNetCore": "Information", |
|||
"Microsoft.EntityFrameworkCore": "Warning", |
|||
"Microsoft.AspNetCore": "Information" |
|||
} |
|||
}, |
|||
"WriteTo": [ |
|||
{ |
|||
"Name": "Console" |
|||
}, |
|||
{ |
|||
"Name": "File", |
|||
"Args": { |
|||
"path": "logs/logs-.txt", |
|||
"rollingInterval": "Day" |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
"App": { |
|||
"SelfUrl": "http://localhost:44315", |
|||
"CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,http://localhost:3100,http://localhost:80,http://localhost" |
|||
}, |
|||
"ConnectionStrings": { |
|||
"Default": "Data Source=localhost;Port=3306;Database=MyCompanyNameMyProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
|||
}, |
|||
"Redis": { |
|||
"Configuration": "localhost,password=1q2w3E*,defaultdatabase=1" |
|||
}, |
|||
"Jwt": { |
|||
"Audience": "MyCompanyName.MyProjectName", |
|||
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", |
|||
"Issuer": "MyCompanyName.MyProjectName", |
|||
"ExpirationTime": 2 |
|||
}, |
|||
"ElasticSearch": { |
|||
"Enabled": "false", |
|||
"Url": "http://es.cn", |
|||
"IndexFormat": "MyCompanyName.MyProjectName.development.{0:yyyy.MM.dd}", |
|||
"UserName": "elastic", |
|||
"Password": "aVVhjQ95RP7nbwNy", |
|||
"SearchIndexFormat": "MyCompanyName.MyProjectName.development*" |
|||
} |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
{ |
|||
"Serilog": { |
|||
"Using": [ |
|||
"Serilog.Sinks.Console", |
|||
"Serilog.Sinks.File" |
|||
], |
|||
"MinimumLevel": { |
|||
"Default": "Debug", |
|||
"Override": { |
|||
"Microsoft": "Information", |
|||
"Volo.Abp": "Information", |
|||
"Hangfire": "Information", |
|||
"DotNetCore.CAP": "Information", |
|||
"Serilog.AspNetCore": "Information", |
|||
"Microsoft.EntityFrameworkCore": "Warning", |
|||
"Microsoft.AspNetCore": "Information" |
|||
} |
|||
}, |
|||
"WriteTo": [ |
|||
{ |
|||
"Name": "Console" |
|||
}, |
|||
{ |
|||
"Name": "File", |
|||
"Args": { |
|||
"path": "logs/logs-.txt", |
|||
"rollingInterval": "Day" |
|||
} |
|||
} |
|||
] |
|||
}, |
|||
"App": { |
|||
"SelfUrl": "http://localhost:44315", |
|||
"CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,http://localhost:3100" |
|||
}, |
|||
"ConnectionStrings": { |
|||
"Default": "Data Source=localhost;Port=3306;Database=MyCompanyNameMyProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true", |
|||
"Hangfire": "localhost,password=mypassword,defaultdatabase=2" |
|||
}, |
|||
"Redis": { |
|||
"Configuration": "localhost,password=1q2w3E*,defaultdatabase=1" |
|||
}, |
|||
"Jwt": { |
|||
"Audience": "MyCompanyName.MyProjectName", |
|||
"SecurityKey": "dzehzRz9a8asdfasfdadfasdfasdfafsdadfasbasdf=", |
|||
"Issuer": "MyCompanyName.MyProjectName", |
|||
"ExpirationTime": 2 |
|||
}, |
|||
"ElasticSearch": { |
|||
"Enabled": "false", |
|||
"Url": "http://es.cn", |
|||
"IndexFormat": "MyCompanyName.MyProjectName.development.{0:yyyy.MM.dd}", |
|||
"UserName": "elastic", |
|||
"Password": "aVVhjQ95RP7nbwNy", |
|||
"SearchIndexFormat": "MyCompanyName.MyProjectName.development*" |
|||
} |
|||
} |
|||
@ -0,0 +1 @@ |
|||
{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"eH-Ld45J684VguyI2jACQEEVGtTx79Nt7ElT20JeUi-pbVnhJxxAJwnAe68d9Q8skpv6BxZs5QuyIORwfGpJK-lKVuo8EtyUQTuUuPmP4o1YK4cv2FIi5xN18tddTltg2JmJi1sN2AD5z-zwm45YNvoFxdQYlnUlA9lJL8QfG0HQLMQX1sv2_lgND8RfRGQBCpVXC2kcap4GvkFVQpKaQ5xaUqvNdH6ftwkGMdFfMRlHGhyYyabIjs4T16HslofvXiHbOCAzk37HtBNNsBpeoQuZul1-G7tAndHe1XtuGvuE-k1fyqdm3YiCU8wK7FpvQU3x6JqvfqmWgMAPnWKOtQ","DP":"hd3I9Nc3LlaZDoPg20JZu48kpv9rMMQ0rLtcZ0UPB_HpZWBC_No-3t3t1HFRbD4iz0MCpCR6gb5q4UsL2N2xh3Q8OhQ1Zrl76UKDZrVKs3oE0VVr9K2VUU3s1sytE4OWSv7PAHYURygcx_MrunMn8Ryd4ZJBQ_g5M2GvpBj1o5M","DQ":"T3ibciK4KxGGHqau9dnWxE6l3fGtcNw1GcjV93Lxe0NKTbfrwPEIFVVAyPsFS8QdmRXEgyunkDFKLHyq2hXBi2fZCwXGoWkUqVUKAKMaNYZaDDd_XeJKOu7mwNY8rgxNETHCyMSnnNNPNabBf2iiXmrBnMwesle2L1kwky42yns","E":"AQAB","K":null,"KeyId":"0D94529E740F5FD50EC6B8A19FF460D6","Kid":"0D94529E740F5FD50EC6B8A19FF460D6","Kty":"RSA","N":"w2jhtWb6a3kH4VqAPfuuvdF5hBh7U6gwMRnddHAH7zaVL6aYwjpCzNW56RQy4W4Zabv1My4Yw9GZpjrOcyr3Bm669eZjn_JC0O00eRTNStNgmg2kB_6AB6ROkEW7br1JC0jKr_dXhOYPBMmR-KHvpwaZXA9R1xOqY02S3JD0KB-TGMSC9q1RlVydt81aMOHFzWVyruLsYGdmcKhRPKDtL6GXpU_DG1gzzOYbk795x_D_UUTOJYuhIDEj7aYi3o32yXLEBvh4Q7HPLjLcWzV-EzCn6Ossl-EVJ2TrR53Eln03R93Vmo63DzQbLIOi3yTcZD2a3O6mpGLiqyZjUducIQ","Oth":null,"P":"y84cEtE6IRBeU2sDJxjDYb50HB4nAF7-bfvbEq0haQL2sFBz-Q-uOUAeXhaS74Gh_IagmW1TzOKblVilijMHCsfOFTWlCljaDoNfdl31enh50HMFvUu8IFjcWiQ9fjR5no8n5-jDeRO5zVfgcWoRHfVTOq4Di7WlVHJRr8FB-R8","Q":"9XRZvvMIvoumlDAVxWZHkb7_an0_dFwBLqc8v74XBZhiK5SLuBqmsJICB5kwNTKzORH7yedx-RXOJWkchJLlEtmH_cQO_6WKQQAyc1PMnLPa0tYkhjotWo8VRE9bAdVmrR0cnJeudfSJ-6gDpUBQYy9g1m8cAfWbTAk3at2_gr8","QI":"xRLXLwhTdNbevlEzANlDDnU9lDeKZWV9-YrvUxHMJBBygBNVqkNFWiee7LNUi82YgTHRn46rpHY9TZf6oQbgk6xa86MyDYXGU2uGO8DHm5oh20Spp7A-RlzZ4JRXAJ3eAYMZHQIP45JApVvKbgHh_pUGjNaiqZKZ9IN6H_L9k1s","Use":null,"X":null,"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true}} |
|||
@ -0,0 +1 @@ |
|||
{"KeyId":"600caa200caf5d805eba9f06ace9e236","Parameters":{"D":"KCNDHA96eimN+UqchSKocgYITGflaAIwxzCS5KqSTkYAFliPthQx7LySuLor4F1+uLvwnh3ZocyI3y43GZu+eVHD256sxdV8/UsQz1HC23RRFqcUiAZjze8K5VMVStrBOxaa/Ds1U9/bpuNE7jZdcgFIEHsdZtCACqwtlE4nlIs1/GLiokqjBOESgxJMy9WUeDbWcvoo+YdwgKf5jt6AZHOYSS+TokLL+Y7TEfGMXe3jZD9VtSMkBSM8wGB89zNGR0FZB9maCG/BCoRJqxdYRyeb4FFXJclQtK3DexyDVqlNZQaNKVHu0tVAnVNKKcd7Iex8gA+5DNqqucUA7C/F6Q==","DP":"fr9iaNb1W4YZ/NJ56+N3SCeDQYuKobq1qeaQWmHlQsOHKoHhNZJQZ5x0M9PQilou16AwVlNGCJncMwxsSUxXn6itG0LcBnvfMeo2v3xKcij1BtFR9qfXecwEn2nnhI3mpXtZxyCdP3NIYUp9qViLJUjGJqrbQk+OIAGRQd2rRe0=","DQ":"o1umLkDodtwvpCsDguQYSjd3iob+WHNmfe/9HyjADmUehP8b9SpUgcrb+QF301J8YmQMnYZKWW5rEwKOtwsWNswgXfMnXeWerlZmz0tj9y38YczS70liU0vETsRefhrRCaXHraMvneqYNNedhsrCNalWK+DNwcixi4L59vA8ofs=","Exponent":"AQAB","InverseQ":"btd1nwwxl/E3ryfDi2bN12TuVDvv7yoPvryIlLgu+FiLpe4vaA1omDLliQBcl7oeyA563HBUop4D5oE7si+jD64N8XgFz37dD3KqUokeQ4lrTSSOePT1K+nWIl30sqDd7YE4auz4CvSjm2wXmN31+CXW1hp3YWN2972yrUt+R5U=","Modulus":"uwMB6reAVtm/Cq0BRPZ0ozBq6g3wDh2kzqFKBf8I7u8d9p7i5ExLSrOWPupHwPr/IW1VUn2TKHrJ8OnyYhznKIRxqlxj0U3D2GXijz5kfFOoHK+mlfKaDMqweRoS0UzEz58kMlgwUoDraUj6dTHTPCVPo3TqA2ImRw50j6D+jobFrY5321EFvlirZViMPDAgB8Ca7wGCqNBcCxvIPYw1O6WZmcVmjG7umelD3XjcUIQlEbIyAmi/3gXAo7NdPmgOamla6bnSWsy429HfsNpXyCfPBzV3QS3ubpTekWPoPcOVZbWwVPYtFQbhRh8PmWATRx0cV6oePZNZGxGeJl8WYQ==","P":"wplelBfVmiOPmr6iUxtOgIzuvwSqvP6Rqmh8dhaGDiJjU8OqZ0tZhuh0G+xnMLPIHb2fMeg0dqZMJZ5iXaIi1QycYn/JKz1i4cUonJ6IIQeKKf67tvzn/BY0V0N8rJw8hVfzou+/5sRBCbiHtJ2KIN1YJQuWGFFfrZJOJzc95ss=","Q":"9gTGKoDiOdrY8kqIXJ2nMhoeNryAH4q3EUrROJ7simqc28oYlGx24Sco/wOoeB2xxrdcF5JYOlyJ7H2YY/huLvJISaw/wHLPskiKiYQ78tuNwW0ip+5ceB1dSToHcEe3sR30+OeTh0Z4ZKoqthKziFGIt3EhEgiGq1gjZuWB5gM="}} |
|||
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 25 KiB |
@ -0,0 +1,12 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.Threading.Tasks; |
|||
global using Volo.Abp.Application.Services; |
|||
global using Volo.Abp.Authorization.Permissions; |
|||
global using Volo.Abp.DependencyInjection; |
|||
global using Volo.Abp.Identity; |
|||
global using Volo.Abp.Localization; |
|||
global using Volo.Abp.Modularity; |
|||
global using Volo.Abp.ObjectExtending; |
|||
global using Volo.Abp.Threading; |
|||
@ -0,0 +1,11 @@ |
|||
namespace MyCompanyName.MyProjectName.Jobs |
|||
{ |
|||
public interface IRecurringJob : ITransientDependency |
|||
{ |
|||
/// <summary>
|
|||
/// 执行任务
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
Task ExecuteAsync(); |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain.Shared\MyCompanyName.MyProjectName.Domain.Shared.csproj"/> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
|
|||
<PackageReference Include="Lion.AbpPro.BasicManagement.Application.Contracts"/> |
|||
<PackageReference Include="Lion.AbpPro.NotificationManagement.Application.Contracts"/> |
|||
<PackageReference Include="Lion.AbpPro.DataDictionaryManagement.Application.Contracts"/> |
|||
</ItemGroup> |
|||
|
|||
|
|||
</Project> |
|||
@ -0,0 +1,21 @@ |
|||
using Lion.AbpPro.BasicManagement; |
|||
using Lion.AbpPro.DataDictionaryManagement; |
|||
using Lion.AbpPro.NotificationManagement; |
|||
|
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
[DependsOn( |
|||
typeof(MyProjectNameDomainSharedModule), |
|||
typeof(AbpObjectExtendingModule), |
|||
typeof(BasicManagementApplicationContractsModule), |
|||
typeof(NotificationManagementApplicationContractsModule), |
|||
typeof(DataDictionaryManagementApplicationContractsModule) |
|||
)] |
|||
public class MyProjectNameApplicationContractsModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
MyProjectNameDtoExtensions.Configure(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
public static class MyProjectNameDtoExtensions |
|||
{ |
|||
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
|||
|
|||
public static void Configure() |
|||
{ |
|||
OneTimeRunner.Run(() => |
|||
{ |
|||
/* You can add extension properties to DTOs |
|||
* defined in the depended modules. |
|||
* |
|||
* Example: |
|||
* |
|||
* ObjectExtensionManager.Instance |
|||
* .AddOrUpdateProperty<IdentityRoleDto, string>("Title"); |
|||
* |
|||
* See the documentation for more: |
|||
* https://docs.abp.io/en/abp/latest/Object-Extensions
|
|||
*/ |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
namespace MyCompanyName.MyProjectName.Permissions |
|||
{ |
|||
public class MyProjectNamePermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<MyProjectNameResource>(name); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
namespace MyCompanyName.MyProjectName.Permissions |
|||
{ |
|||
public static class MyProjectNamePermissions |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.Collections.Generic; |
|||
global using System.Linq; |
|||
global using System.Threading.Tasks; |
|||
global using Lion.AbpPro.BasicManagement; |
|||
global using Lion.AbpPro.NotificationManagement; |
|||
global using MyCompanyName.MyProjectName.FreeSqlRepository; |
|||
global using MyCompanyName.MyProjectName.Permissions; |
|||
global using Microsoft.AspNetCore.Authorization; |
|||
global using Microsoft.Extensions.Configuration; |
|||
global using Volo.Abp.Application.Services; |
|||
global using Volo.Abp.AutoMapper; |
|||
global using Volo.Abp.BackgroundJobs.Hangfire; |
|||
global using Volo.Abp.DependencyInjection; |
|||
global using Volo.Abp.Modularity; |
|||
global using Profile = AutoMapper.Profile; |
|||
@ -0,0 +1,11 @@ |
|||
namespace MyCompanyName.MyProjectName.Jobs |
|||
{ |
|||
public class TestJob : IRecurringJob |
|||
{ |
|||
public Task ExecuteAsync() |
|||
{ |
|||
Console.WriteLine($"job 测试- {DateTime.Now}"); |
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain\MyCompanyName.MyProjectName.Domain.csproj" /> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application.Contracts\MyCompanyName.MyProjectName.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.FreeSqlRepository\MyCompanyName.MyProjectName.FreeSqlRepository.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
|
|||
<PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" /> |
|||
<PackageReference Include="Lion.AbpPro.BasicManagement.Application" /> |
|||
<PackageReference Include="Lion.AbpPro.NotificationManagement.Application" /> |
|||
<PackageReference Include="Lion.AbpPro.DataDictionaryManagement.Application" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
/* Inherit your application services from this class. |
|||
*/ |
|||
public abstract class MyProjectNameAppService : ApplicationService |
|||
{ |
|||
protected MyProjectNameAppService() |
|||
{ |
|||
LocalizationResource = typeof(MyProjectNameResource); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
public class MyProjectNameApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public MyProjectNameApplicationAutoMapperProfile() |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using Lion.AbpPro.DataDictionaryManagement; |
|||
|
|||
namespace MyCompanyName.MyProjectName |
|||
{ |
|||
[DependsOn( |
|||
typeof(MyProjectNameDomainModule), |
|||
typeof(MyProjectNameApplicationContractsModule), |
|||
typeof(BasicManagementApplicationModule), |
|||
typeof(NotificationManagementApplicationModule), |
|||
typeof(DataDictionaryManagementApplicationModule), |
|||
typeof(MyProjectNameFreeSqlModule) |
|||
)] |
|||
public class MyProjectNameApplicationModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddMaps<MyProjectNameApplicationModule>(); |
|||
}); |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,2 @@ |
|||
using System.Runtime.CompilerServices; |
|||
[assembly:InternalsVisibleToAttribute("MyCompanyName.MyProjectName.Application.Tests")] |
|||
@ -0,0 +1,43 @@ |
|||
namespace MyCompanyName.MyProjectName.DbMigrator |
|||
{ |
|||
public class DbMigratorHostedService : IHostedService |
|||
{ |
|||
private readonly IHostApplicationLifetime _hostApplicationLifetime; |
|||
private readonly IConfiguration _configuration; |
|||
private readonly IHostEnvironment _hostEnvironment; |
|||
public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, |
|||
IConfiguration configuration, IHostEnvironment hostEnvironment) |
|||
{ |
|||
_hostApplicationLifetime = hostApplicationLifetime; |
|||
_configuration = configuration; |
|||
_hostEnvironment = hostEnvironment; |
|||
} |
|||
|
|||
public async Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
using (var application = await AbpApplicationFactory.CreateAsync<MyProjectNameDbMigratorModule>(options => |
|||
{ |
|||
options.Services.ReplaceConfiguration(_configuration); |
|||
options.UseAutofac(); |
|||
options.Services.AddLogging(c => c.AddSerilog()); |
|||
})) |
|||
{ |
|||
await application.InitializeAsync(); |
|||
var conn = _configuration.GetValue<string>("ConnectionStrings:Default"); |
|||
Console.WriteLine("ConnectionStrings:" + conn); |
|||
var s = _hostEnvironment.EnvironmentName; |
|||
Console.WriteLine("EnvironmentName:" + s); |
|||
await application |
|||
.ServiceProvider |
|||
.GetRequiredService<MyProjectNameDbMigrationService>() |
|||
.MigrateAsync(); |
|||
|
|||
await application.ShutdownAsync(); |
|||
|
|||
_hostApplicationLifetime.StopApplication(); |
|||
} |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 |
|||
|
|||
# 创建目录 |
|||
RUN mkdir /app |
|||
|
|||
COPY publish /app |
|||
|
|||
# 设置工作目录 |
|||
WORKDIR /app |
|||
|
|||
# 设置时区 .net6 才有这个问题 |
|||
ENV TZ=Asia/Shanghai |
|||
|
|||
# 设置环境变量 |
|||
ENV ASPNETCORE_ENVIRONMENT=Production |
|||
|
|||
ENTRYPOINT ["dotnet", "MyCompanyName.MyProjectName.DbMigrator.dll"] |
|||
|
|||
|
|||
@ -0,0 +1,18 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.IO; |
|||
global using System.Threading; |
|||
global using System.Threading.Tasks; |
|||
global using MyCompanyName.MyProjectName.Data; |
|||
global using MyCompanyName.MyProjectName.EntityFrameworkCore; |
|||
global using Microsoft.Extensions.Configuration; |
|||
global using Microsoft.Extensions.DependencyInjection; |
|||
global using Microsoft.Extensions.Hosting; |
|||
global using Microsoft.Extensions.Logging; |
|||
global using Serilog; |
|||
global using Serilog.Events; |
|||
global using Volo.Abp; |
|||
global using Volo.Abp.Autofac; |
|||
global using Volo.Abp.BackgroundJobs; |
|||
global using Volo.Abp.Modularity; |
|||
@ -0,0 +1,35 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
|
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net7.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Serilog.Extensions.Logging" /> |
|||
<PackageReference Include="Serilog.Sinks.Async" /> |
|||
<PackageReference Include="Serilog.Sinks.File" /> |
|||
<PackageReference Include="Serilog.Sinks.Console" /> |
|||
<PackageReference Include="Volo.Abp.Autofac" /> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
|
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application.Contracts\MyCompanyName.MyProjectName.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Compile Remove="Logs\**" /> |
|||
<Content Remove="Logs\**" /> |
|||
<EmbeddedResource Remove="Logs\**" /> |
|||
<None Remove="Logs\**" /> |
|||
<None Update="appsettings.json"> |
|||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|||
</None> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,15 @@ |
|||
namespace MyCompanyName.MyProjectName.DbMigrator |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAutofacModule), |
|||
typeof(MyProjectNameEntityFrameworkCoreModule), |
|||
typeof(MyProjectNameApplicationContractsModule) |
|||
)] |
|||
public class MyProjectNameDbMigratorModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = false); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
namespace MyCompanyName.MyProjectName.DbMigrator |
|||
{ |
|||
class Program |
|||
{ |
|||
static async Task Main(string[] args) |
|||
{ |
|||
Log.Logger = new LoggerConfiguration() |
|||
.MinimumLevel.Information() |
|||
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning) |
|||
.MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) |
|||
#if DEBUG
|
|||
.MinimumLevel.Override("MyCompanyName.MyProjectName", LogEventLevel.Debug) |
|||
#else
|
|||
.MinimumLevel.Override("MyCompanyName.MyProjectName", LogEventLevel.Information) |
|||
#endif
|
|||
.Enrich.FromLogContext() |
|||
.WriteTo.Async(c => c.File("Logs/logs.txt")) |
|||
.WriteTo.Async(c => c.Console()) |
|||
.CreateLogger(); |
|||
|
|||
await CreateHostBuilder(args).RunConsoleAsync(); |
|||
} |
|||
|
|||
public static IHostBuilder CreateHostBuilder(string[] args) => |
|||
Host.CreateDefaultBuilder(args) |
|||
.ConfigureLogging((context, logging) => logging.ClearProviders()) |
|||
.ConfigureAppConfiguration |
|||
( |
|||
otpions => |
|||
{ |
|||
var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); |
|||
|
|||
var appSettingFileName = "appsettings.json"; |
|||
if (!environment.IsNullOrWhiteSpace()) |
|||
appSettingFileName = $"appsettings.{environment}.json"; |
|||
|
|||
otpions.AddJsonFile(appSettingFileName, optional: true); |
|||
} |
|||
) |
|||
.ConfigureServices((hostContext, services) => |
|||
{ |
|||
services.AddHostedService<DbMigratorHostedService>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"ConnectionStrings": { |
|||
"Default": "Data Source=localhost;Port=3306;Database=MyCompanyNameMyProjectNameDB;uid=root;pwd=1q2w3E*;charset=utf8mb4;Allow User Variables=true;AllowLoadLocalInfile=true" |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
{ |
|||
"KeyId": "f788zGVUZh9H-HbWL1S-Mg", |
|||
"Parameters": { |
|||
"D": "F19hbC5PLO872DszGiJnVoU55ee7XGXmNf0KEKndJ/uGBv5lWklXA0QF80h1ytWXde0jV5isQPB1t7mPhRQlDoDTkywLi1CeOgBPbxzHEfLjZZ5c4olfeX0IJX9BDqgUntY0H1a/+Om/eDu4OZUz3EIJFFZBgz46YZSyTT6ZDvAEdpC/o66sNJmxvJIp+8zVoVDSqBUzxmc+oEamXLg7r2jdymxJMxau1kQFxEGLOrJnNxGsEe8UrYA3qSsm8m/Xg4uOh7RYgnuEEt88+KTvRq+CAMWhN3YNLtOJ3NmXowwE7e1Ma+jih9+UVfxZn14P5+SOJbQ2bYV2sCV+2vBiCQ==", |
|||
"DP": "oPiGO/qdOQfFEAS9fMInQnsrNylIZVpDYEVoDJ6/jQfE/IpuwxGcmsaGvCob3SKxZiJRLCWpwJYo1hCh/JOSVGWMkVyELky56nbbkkV5ymKLSGZ4JoetdQs+GchnPdR+k2P9Ij1Kjk13ylubN3htzNhcBASJpOfSEv5pPVzGKX0=", |
|||
"DQ": "z6imxLABHkyftbfUUtpeOlPanEHgpuIjmUdp3T1Ju1jziE63UEhuj0GPAXOF17uYxixwYE8JhOJ7+TyIK9oZeI3zH2OzJqQh8f5PCQ/E+0ULXZDeNV/ShDLCTufu3Fis9Rt64uTp/H/l21oMQ79jc0ysa8DTz1ReJLRc5qjL41U=", |
|||
"Exponent": "AQAB", |
|||
"InverseQ": "ieZcvSt5XYukKJKhXpv5Dm/1RD7iH88cZnhLSTEVTMoOUHoYWmApY5pNLGahbfjA9bxnkBWDYex/i7wE9uNNY5CsA6ovUaQLVJDt3kHvR9W+9QtN8D6jjG2TuRbbOdEg4RqhfjUaDfDIgTJX2Wxc8U98FOvOyGw1HzwUPFZKecM=", |
|||
"Modulus": "vk4z1Bmtmbo+gxITcY+FIlXzcO2wTOGlOXK5GMYj/6PUMFt7lbqkc72AkPsrAo5/JE8LYLhWj7fzSKbjvtowHCz5m2t+FlUYmuiKpvvnJsTqvQrckNlbZ1nm071q5PhP3Dar/OksfBhPtAX+c3+NjDnM/w53ccJJNaBDO/s9JYoN7vH5n6ed1pMSK71hmg4MPsxChcnc1f1PpnG2mqyJ253+GEUbj/kRyeBSmCCr9aadov2ZzxIKVaFNagJEHOzanQmorSLpP25GfOHCuy27Zkef94V/qU9elzjbH4uIKslVGx5T6H99TYh0sUGu11NytYJa5WNAZWow95CzurC2vw==", |
|||
"P": "4GMCQy+XTNzR5TsgFcdAZv2K6TcQR13fHVvPoxQp/b32V5YUJOBFEUAtqociy5ro4+KzpXP5WPSk1ZtznGKuNZyLq8gTnhpB3rwd0sdo4zxKnQ5nu+n1UhlhWNxg5A9V5TaciUAyPrHWJfLoYTQWygNTgJELQH5zZXi2ihC2uiU=", |
|||
"Q": "2R36pamnLAJggkPJxiW5qH6HizZ+bkQVg0BBftMLzkAM8Y9CwTW75GRUzGEJFpMckkw0GZSYb1Uwl3DVUpkcQ8LZ91IPYdPpDlYUshhIxl184M55pnO14besKxJtMZ64zhHKVAR2pBMO0n6W4/1iBXkkQqyPViJxdfvXPJMBbhM=" |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
// Global using directives
|
|||
|
|||
global using System; |
|||
global using System.Collections.Generic; |
|||
global using System.ComponentModel.DataAnnotations; |
|||
global using System.Linq; |
|||
global using System.Reflection; |
|||
global using System.Text; |
|||
global using System.Threading.Tasks; |
|||
global using Microsoft.Extensions.DependencyInjection; |
|||
global using Microsoft.Extensions.Localization; |
|||
global using Volo.Abp; |
|||
global using Volo.Abp.AuditLogging; |
|||
global using Volo.Abp.BackgroundJobs; |
|||
global using Volo.Abp.Data; |
|||
global using Volo.Abp.DependencyInjection; |
|||
global using Volo.Abp.FeatureManagement; |
|||
global using Volo.Abp.Identity; |
|||
global using Volo.Abp.Identity.Localization; |
|||
global using Volo.Abp.Localization; |
|||
global using Volo.Abp.Localization.ExceptionHandling; |
|||
global using Volo.Abp.Localization.Resources.AbpLocalization; |
|||
global using Volo.Abp.Modularity; |
|||
global using Volo.Abp.ObjectExtending; |
|||
global using Volo.Abp.PermissionManagement; |
|||
global using Volo.Abp.SettingManagement; |
|||
global using Volo.Abp.SettingManagement.Localization; |
|||
global using Volo.Abp.TenantManagement; |
|||
global using Volo.Abp.Threading; |
|||
global using Volo.Abp.Timing.Localization.Resources.AbpTiming; |
|||
global using Volo.Abp.Validation; |
|||
global using Volo.Abp.Validation.Localization; |
|||
global using Volo.Abp.VirtualFileSystem; |
|||
@ -0,0 +1,19 @@ |
|||
// namespace MyCompanyName.MyProjectName.Localization.Extensions
|
|||
// {
|
|||
// public static class EnumLocalicationExtension
|
|||
// {
|
|||
// public static string ToLocalicationDescription(this Enum value)
|
|||
// {
|
|||
// var member =
|
|||
// ((IEnumerable<MemberInfo>)value.GetType().GetMember(value.ToString()))
|
|||
// .FirstOrDefault<MemberInfo>();
|
|||
//
|
|||
// var localKey =$"Enum:{member.ReflectedType.Name}:{value}:{Convert.ToInt16(value)}";
|
|||
// if (localKey.IsNullOrWhiteSpace())
|
|||
// {
|
|||
// throw new ArgumentException();
|
|||
// }
|
|||
// return !(member != (MemberInfo)null) ? value.ToString() : LocalizationHelper.L[localKey];
|
|||
// }
|
|||
// }
|
|||
// }
|
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "ar", |
|||
"texts": { |
|||
"Menu:Home": "الرئيسية", |
|||
"Welcome": "مرحبا", |
|||
"LongWelcomeMessage": "مرحبا بكم في التطبيق. هذا مشروع بدء تشغيل يعتمد على إطار عمل ABP. لمزيد من المعلومات ، يرجى زيارة abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "cs", |
|||
"texts": { |
|||
"Menu:Home": "Úvod", |
|||
"Welcome": "Vítejte", |
|||
"LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "de-DE", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Willkommen", |
|||
"LongWelcomeMessage": "Willkommen bei der Anwendung. Dies ist ein Startup-Projekt, das auf dem ABP-Framework basiert. Weitere Informationen finden Sie unter abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "en-GB", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Welcome", |
|||
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Welcome", |
|||
"Test": "Test", |
|||
"LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io.", |
|||
"Permission:Query": "Query", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Permission:Export": "Export", |
|||
"Permission:Enable": "Enable|Disable", |
|||
"Permission:SystemManagement": "SystemManagement", |
|||
"Permission:AuditLogManagement": "AuditLog", |
|||
"Permission:HangfireManagement": "BackgroundTask", |
|||
"Permission:CapManagement": "IntegratedEvent", |
|||
"Permission:ESManagement": "ESManagement", |
|||
"Permission:SettingManagement": "SettingManagement", |
|||
"Permission:OrganizationUnitManagement": "OrganizationUnitManagement", |
|||
"Setting.Group.System": "System", |
|||
"Setting.Group.Other": "Other", |
|||
"DisplayName:Setting.Group.Other.Github": "Github", |
|||
"Description:Setting.Group.Other.Github": "Github", |
|||
"Enum:TestType:Created:1":"Created", |
|||
"Enum:TestType:Cancel:1":"Cancel", |
|||
"Enum:TestType:Delete:1":"Delete", |
|||
|
|||
"MyCompanyName.MyProjectName:100001": "OrganizationUnit Not Exist", |
|||
"MyCompanyName.MyProjectName:100002": "UserLockedOut", |
|||
"MyCompanyName.MyProjectName:100003": "UserOrPasswordMismatch", |
|||
"MyCompanyName.MyProjectName:100004": "ApiResource Not Exist", |
|||
"MyCompanyName.MyProjectName:100005": "ApiResource Exist", |
|||
"MyCompanyName.MyProjectName:100006": "ApiScope Not Exist", |
|||
"MyCompanyName.MyProjectName:100007": "ApiScope Exist", |
|||
"MyCompanyName.MyProjectName:100008": "ApiClient Not Exist", |
|||
"MyCompanyName.MyProjectName:100009": "ApiClient Exist", |
|||
"MyCompanyName.MyProjectName:100010": "IdentityResource Not Exist", |
|||
"MyCompanyName.MyProjectName:100011": "IdentityResource Exist" |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "es", |
|||
"texts": { |
|||
"Menu:Home": "Inicio", |
|||
"Welcome": "Bienvenido", |
|||
"LongWelcomeMessage": "Bienvenido a la aplicación, este es un proyecto base basado en el framework ABP. Para más información, visita abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "fr", |
|||
"texts": { |
|||
"Menu:Home": "Accueil", |
|||
"Welcome": "Bienvenue", |
|||
"LongWelcomeMessage": "Bienvenue dans l'application. Il s'agit d'un projet de démarrage basé sur le framework ABP. Pour plus d'informations, visitez abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "hu", |
|||
"texts": { |
|||
"Menu:Home": "Kezdőlap", |
|||
"Welcome": "Üdvözlöm", |
|||
"LongWelcomeMessage": "Üdvözöljük az alkalmazásban. Ez egy ABP keretrendszeren alapuló startup projekt. További információkért látogasson el az abp.io oldalra." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "nl", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Welkom", |
|||
"LongWelcomeMessage": "Welkom bij de applicatie. Dit is een startup-project gebaseerd op het ABP-framework. Bezoek abp.io voor meer informatie." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "pl-PL", |
|||
"texts": { |
|||
"Menu:Home": "Home", |
|||
"Welcome": "Witaj", |
|||
"LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io." |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
{ |
|||
"culture": "pt-BR", |
|||
"texts": { |
|||
"Menu:Home": "Principal", |
|||
"Welcome": "Seja bem-vindo!", |
|||
"LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io." |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue