Browse Source

feat: 调整cli

main 10.0.1.1
wangjunzzz 2 months ago
parent
commit
ae6a16bf8d
  1. 2
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/CliService.cs
  2. 3
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs
  3. 3
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs
  4. 55
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplaceHelper.cs
  5. 4
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplacePackageReferenceExtensions.cs
  6. 340
      aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplacePackageReferenceVben5Extensions.cs
  7. 55
      aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

2
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/CliService.cs

@ -20,7 +20,7 @@ public class CliService : DomainService
public async Task RunAsync(string[] args)
{
AnsiConsole.MarkupLine("[green]ABP Pro CLI (http://doc.cncore.club/)[/]");
AnsiConsole.MarkupLine("[green]ABP Pro CLI (http://docs.chengzhi.online/)[/]");
AnsiConsole.MarkupLine("[green]请输入lion.abp help 查看所有命令[/]");
try
{

3
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/CreateCommand.cs

@ -128,7 +128,8 @@ public class CreateCommand : IConsoleCommand, ITransientDependency
projectName,
string.Empty,
templateOptions.ReplaceSuffix,
version);
version,
true);
_logger.LogInformation($"创建模板成功,请查阅----->: {output}");

3
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Commands/NewCommand.cs

@ -139,7 +139,8 @@ public class NewCommand : IConsoleCommand, ITransientDependency
projectName,
moduleName,
templateOptions.ReplaceSuffix,
version);
version,
false);
_logger.LogInformation($"创建模板成功,请查阅----->: {output}");

55
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplaceHelper.cs

@ -11,11 +11,12 @@ public static class ReplaceHelper
string projectName,
string moduleName,
string replaceSuffix,
string version)
string version,
bool vben5)
{
try
{
RenameTemplate(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version);
RenameTemplate(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version, vben5);
}
catch (Exception ex)
{
@ -32,10 +33,11 @@ public static class ReplaceHelper
string projectName,
string moduleName,
string replaceSuffix,
string version)
string version,
bool vben5)
{
RenameAllDirectories(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version);
RenameAllFileNameAndContent(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version);
RenameAllDirectories(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version, vben5);
RenameAllFileNameAndContent(sourcePath, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version, vben5);
}
private static void RenameAllDirectories(
@ -46,12 +48,13 @@ public static class ReplaceHelper
string companyName,
string projectName,
string moduleName,
string version)
string version,
bool vben5)
{
var directories = Directory.GetDirectories(sourcePath);
foreach (var subDirectory in directories)
{
RenameAllDirectories(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version);
RenameAllDirectories(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version, vben5);
var directoryInfo = new DirectoryInfo(subDirectory);
if (directoryInfo.Name.Contains(oldCompanyName) ||
@ -59,7 +62,7 @@ public static class ReplaceHelper
directoryInfo.Name.Contains(oldModuleName))
{
var oldDirectoryName = directoryInfo.Name;
var newDirectoryName = oldDirectoryName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version);
var newDirectoryName = oldDirectoryName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version, vben5);
var newDirectoryPath = Path.Combine(directoryInfo.Parent?.FullName, newDirectoryName);
@ -81,7 +84,8 @@ public static class ReplaceHelper
string projectName,
string moduleName,
string replaceSuffix,
string version)
string version,
bool vben5)
{
var list = new DirectoryInfo(sourcePath)
.GetFiles()
@ -93,7 +97,7 @@ public static class ReplaceHelper
{
// 改文件内容
var oldContents = File.ReadAllText(fileInfo.FullName, encoding);
var newContents = oldContents.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version);
var newContents = oldContents.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version, vben5);
// 文件名包含模板关键字
if (fileInfo.Name.Contains(oldCompanyName)
@ -101,7 +105,7 @@ public static class ReplaceHelper
|| fileInfo.Name.Contains(oldModuleName))
{
var oldFileName = fileInfo.Name;
var newFileName = oldFileName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version);
var newFileName = oldFileName.CustomReplace(oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, version, vben5);
var newFilePath = Path.Combine(fileInfo.DirectoryName, newFileName);
// 无变化才重命名
@ -118,7 +122,7 @@ public static class ReplaceHelper
foreach (var subDirectory in Directory.GetDirectories(sourcePath))
{
RenameAllFileNameAndContent(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version);
RenameAllFileNameAndContent(subDirectory, oldCompanyName, oldProjectName, oldModuleName, companyName, projectName, moduleName, replaceSuffix, version, vben5);
}
}
@ -131,15 +135,38 @@ public static class ReplaceHelper
string companyName,
string projectName,
string moduleName,
string version)
string version,
bool vben5)
{
var result = content.ReplacePackageReferenceBasicManagement()
string result;
if (!vben5)
{
result = content.ReplacePackageReferenceBasicManagement()
.ReplacePackageReferenceLanguageManagement()
.ReplacePackageReferenceFileManagement()
.ReplacePackageReferenceDataDictionaryManagement()
.ReplacePackageReferenceNotificationManagement()
.ReplacePackageReferenceCore()
.ReplaceLionPackageVersion(version);
}
else
{
result = content.Vben5ReplacePackageReferenceBasicManagement()
.Vben5ReplacePackageReferenceLanguageManagement()
.Vben5ReplacePackageReferenceFileManagement()
.Vben5ReplacePackageReferenceDataDictionaryManagement()
.Vben5ReplacePackageReferenceNotificationManagement()
.Vben5ReplacePackageReferenceCodeManagement()
.Vben5ReplacePackageReferenceTemplateManagement()
.Vben5ReplacePackageReferenceFileManagement()
.Vben5ReplacePackageReferenceImportExportManagement()
.Vben5ReplacePackageReferenceDynamicMenuManagement()
.Vben5ReplacePackageReferenceCacheManagement()
.Vben5ReplacePackageReferenceMasterDataManagement()
.Vben5ReplacePackageReferenceCore()
.Vben5ReplaceLionPackageVersion(version);
}
if (oldModuleName.IsNullOrWhiteSpace() || oldModuleName.IsNullOrWhiteSpace())
{

4
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplacePackageReferenceExtensions.cs

@ -1,4 +1,4 @@
namespace Lion.AbpPro.Cli.Utils;
namespace Lion.AbpPro.Cli.Utils;
public static class ReplacePackageReferenceExtensions
{
@ -15,8 +15,6 @@ public static class ReplacePackageReferenceExtensions
"<PackageReference Include=\"Lion.AbpPro.Shared.Hosting.Gateways\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\..\\aspnet-core\\frameworks\\src\\Lion.AbpPro.AspNetCore\\Lion.AbpPro.AspNetCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.AspNetCore\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\frameworks\\src\\Lion.AbpPro.AspNetCore\\Lion.AbpPro.AspNetCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.AspNetCore\"/>")
;
}

340
aspnet-core/frameworks/src/Lion.AbpPro.Cli.Core/Lion/AbpPro/Cli/Utils/ReplacePackageReferenceVben5Extensions.cs

@ -0,0 +1,340 @@
namespace Lion.AbpPro.Cli.Utils;
public static class ReplacePackageReferenceVben5Extensions
{
public static string Vben5ReplacePackageReferenceCore(this string content)
{
return content
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\frameworks\\src\\Lion.AbpPro.Core\\Lion.AbpPro.Core.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.Core\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\frameworks\\src\\Lion.AbpPro.Core\\Lion.AbpPro.Core.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.Core\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\shared\\Lion.AbpPro.Shared.Hosting.Microservices\\Lion.AbpPro.Shared.Hosting.Microservices.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.Shared.Hosting.Microservices\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\shared\\Lion.AbpPro.Shared.Hosting.Gateways\\Lion.AbpPro.Shared.Hosting.Gateways.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.Shared.Hosting.Gateways\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\frameworks\\src\\Lion.AbpPro.AspNetCore\\Lion.AbpPro.AspNetCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.AspNetCore\"/>")
;
}
public static string Vben5ReplacePackageReferenceBasicManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.Application\\Lion.AbpPro.BasicManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.Application.Contracts\\Lion.AbpPro.BasicManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.Application.Contracts\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.Domain\\Lion.AbpPro.BasicManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.Domain.Shared\\Lion.AbpPro.BasicManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.EntityFrameworkCore\\Lion.AbpPro.BasicManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.FreeSqlRepository\\Lion.AbpPro.BasicManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.HttpApi\\Lion.AbpPro.BasicManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\BasicManagement\\src\\Lion.AbpPro.BasicManagement.HttpApi.Client\\Lion.AbpPro.BasicManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.BasicManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceDataDictionaryManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.Application\\Lion.AbpPro.DataDictionaryManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.Application.Contracts\\Lion.AbpPro.DataDictionaryManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.Domain\\Lion.AbpPro.DataDictionaryManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.Domain.Shared\\Lion.AbpPro.DataDictionaryManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\\Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.FreeSqlRepository\\Lion.AbpPro.DataDictionaryManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.HttpApi\\Lion.AbpPro.DataDictionaryManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DataDictionaryManagement\\src\\Lion.AbpPro.DataDictionaryManagement.HttpApi.Client\\Lion.AbpPro.DataDictionaryManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DataDictionaryManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceFileManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.Application\\Lion.AbpPro.FileManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.Application.Contracts\\Lion.AbpPro.FileManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.Application.Contracts\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.Domain\\Lion.AbpPro.FileManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.Domain.Shared\\Lion.AbpPro.FileManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.EntityFrameworkCore\\Lion.AbpPro.FileManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.FreeSqlRepository\\Lion.AbpPro.FileManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace("<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.HttpApi\\Lion.AbpPro.FileManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\FileManagement\\src\\Lion.AbpPro.FileManagement.HttpApi.Client\\Lion.AbpPro.FileManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FileManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceLanguageManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.Application\\Lion.AbpPro.LanguageManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.Application.Contracts\\Lion.AbpPro.LanguageManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.Domain\\Lion.AbpPro.LanguageManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.Domain.Shared\\Lion.AbpPro.LanguageManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.EntityFrameworkCore\\Lion.AbpPro.LanguageManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.FreeSqlRepository\\Lion.AbpPro.LanguageManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.HttpApi\\Lion.AbpPro.LanguageManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\LanguageManagement\\src\\Lion.AbpPro.LanguageManagement.HttpApi.Client\\Lion.AbpPro.LanguageManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.LanguageManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceNotificationManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.Application\\Lion.AbpPro.NotificationManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.Application.Contracts\\Lion.AbpPro.NotificationManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.Domain\\Lion.AbpPro.NotificationManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.Domain.Shared\\Lion.AbpPro.NotificationManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.EntityFrameworkCore\\Lion.AbpPro.NotificationManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.FreeSqlRepository\\Lion.AbpPro.NotificationManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.HttpApi\\Lion.AbpPro.NotificationManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\NotificationManagement\\src\\Lion.AbpPro.NotificationManagement.HttpApi.Client\\Lion.AbpPro.NotificationManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.NotificationManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceCodeManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.Application\\Lion.AbpPro.CodeManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.Application.Contracts\\Lion.AbpPro.CodeManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.Domain\\Lion.AbpPro.CodeManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.Domain.Shared\\Lion.AbpPro.CodeManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.EntityFrameworkCore\\Lion.AbpPro.CodeManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.FreeSqlRepository\\Lion.AbpPro.CodeManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.HttpApi\\Lion.AbpPro.CodeManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CodeManagement\\src\\Lion.AbpPro.CodeManagement.HttpApi.Client\\Lion.AbpPro.CodeManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CodeManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceTemplateManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.Application\\Lion.AbpPro.TemplateManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.Application.Contracts\\Lion.AbpPro.TemplateManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.Domain\\Lion.AbpPro.TemplateManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.Domain.Shared\\Lion.AbpPro.TemplateManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.EntityFrameworkCore\\Lion.AbpPro.TemplateManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.FreeSqlRepository\\Lion.AbpPro.TemplateManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.HttpApi\\Lion.AbpPro.TemplateManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\TemplateManagement\\src\\Lion.AbpPro.TemplateManagement.HttpApi.Client\\Lion.AbpPro.TemplateManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.TemplateManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceDynamicMenuManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.Application\\Lion.AbpPro.DynamicMenuManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.Application.Contracts\\Lion.AbpPro.DynamicMenuManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.Domain\\Lion.AbpPro.DynamicMenuManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.Domain.Shared\\Lion.AbpPro.DynamicMenuManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.EntityFrameworkCore\\Lion.AbpPro.DynamicMenuManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.FreeSqlRepository\\Lion.AbpPro.DynamicMenuManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.HttpApi\\Lion.AbpPro.DynamicMenuManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\DynamicMenuManagement\\src\\Lion.AbpPro.DynamicMenuManagement.HttpApi.Client\\Lion.AbpPro.DynamicMenuManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.DynamicMenuManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceImportExportManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.Application\\Lion.AbpPro.ImportExportManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.Application.Contracts\\Lion.AbpPro.ImportExportManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.Domain\\Lion.AbpPro.ImportExportManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.Domain.Shared\\Lion.AbpPro.ImportExportManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.EntityFrameworkCore\\Lion.AbpPro.ImportExportManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.FreeSqlRepository\\Lion.AbpPro.ImportExportManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.HttpApi\\Lion.AbpPro.ImportExportManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\ImportExportManagement\\src\\Lion.AbpPro.ImportExportManagement.HttpApi.Client\\Lion.AbpPro.ImportExportManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.ImportExportManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceCacheManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.Application\\Lion.AbpPro.CacheManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.Application.Contracts\\Lion.AbpPro.CacheManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.Domain\\Lion.AbpPro.CacheManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.Domain.Shared\\Lion.AbpPro.CacheManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.EntityFrameworkCore\\Lion.AbpPro.CacheManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.FreeSqlRepository\\Lion.AbpPro.CacheManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.HttpApi\\Lion.AbpPro.CacheManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\CacheManagement\\src\\Lion.AbpPro.CacheManagement.HttpApi.Client\\Lion.AbpPro.CacheManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.CacheManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplacePackageReferenceMasterDataManagement(this string content)
{
return content
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.Application\\Lion.AbpPro.MasterDataManagement.Application.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.Application\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.Application.Contracts\\Lion.AbpPro.MasterDataManagement.Application.Contracts.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.Application.Contracts\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.Domain\\Lion.AbpPro.MasterDataManagement.Domain.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.Domain\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.Domain.Shared\\Lion.AbpPro.MasterDataManagement.Domain.Shared.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.Domain.Shared\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.EntityFrameworkCore\\Lion.AbpPro.MasterDataManagement.EntityFrameworkCore.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.EntityFrameworkCore\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.FreeSqlRepository\\Lion.AbpPro.MasterDataManagement.FreeSqlRepository.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.FreeSqlRepository\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.HttpApi\\Lion.AbpPro.MasterDataManagement.HttpApi.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.HttpApi\"/>")
.Replace(
"<ProjectReference Include=\"..\\..\\..\\..\\aspnet-core\\modules\\MasterDataManagement\\src\\Lion.AbpPro.MasterDataManagement.HttpApi.Client\\Lion.AbpPro.MasterDataManagement.HttpApi.Client.csproj\"/>",
"<PackageReference Include=\"Lion.AbpPro.MasterDataManagement.HttpApi.Client\"/>");
}
public static string Vben5ReplaceLionPackageVersion(this string context, string version)
{
return context.Replace("MyVersion", version);
}
}

55
aspnet-core/services/host/Lion.AbpPro.HttpApi.Host/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

@ -1,4 +1,3 @@
using Lion.AbpPro.Hangfire;
using Microsoft.AspNetCore.SignalR.StackExchangeRedis;
#pragma warning disable CS0618 // Type or member is obsolete
@ -13,8 +12,8 @@ public static class ServiceCollectionExtensions
public static IServiceCollection AddAbpProRedis(this IServiceCollection service, Action<AbpDistributedCacheOptions> configureOptions = null)
{
var configuration = service.GetConfiguration();
var redisEnabled = configuration["Redis:IsEnabled"];
if (!string.IsNullOrEmpty(redisEnabled) && !bool.Parse(redisEnabled)) return service;
var redisEnabled = configuration.GetValue<bool>("Redis:IsEnabled");
if (!redisEnabled) return service;
if (configureOptions != null)
{
@ -36,8 +35,8 @@ public static class ServiceCollectionExtensions
public static IServiceCollection AddAbpProRedisDistributedLocking(this IServiceCollection service)
{
var configuration = service.GetConfiguration();
var redisEnabled = configuration["Redis:IsEnabled"];
if (!string.IsNullOrEmpty(redisEnabled) && !bool.Parse(redisEnabled)) return service;
var redisEnabled = configuration.GetValue<bool>("Redis:IsEnabled");
if (!redisEnabled) return service;
var connectionString = configuration.GetValue<string>("Redis:Configuration");
service.AddSingleton<IDistributedLockProvider>(sp =>
@ -63,8 +62,8 @@ public static class ServiceCollectionExtensions
public static IServiceCollection AddAbpProSignalR(this IServiceCollection service, Action<RedisOptions> redisOptions = null)
{
var configuration = service.GetConfiguration();
var redisEnabled = configuration["Redis:IsEnabled"];
if (!string.IsNullOrEmpty(redisEnabled) && !bool.Parse(redisEnabled))
var redisEnabled = configuration.GetValue<bool>("Redis:IsEnabled");
if (redisEnabled)
{
if (redisOptions != null)
{
@ -97,27 +96,27 @@ public static class ServiceCollectionExtensions
return service;
}
/// <summary>
/// 注册cap
/// </summary>
public static IServiceCollection AddAbpProCap(this IServiceCollection service)
{
var configuration = service.GetConfiguration();
service.AddAbpCap(capOptions =>
{
capOptions.SetCapDbConnectionString(configuration["ConnectionStrings:Default"]);
capOptions.UseEntityFramework<AbpProDbContext>();
capOptions.UseRabbitMQ(option =>
{
option.HostName = configuration.GetValue<string>("Cap:RabbitMq:HostName");
option.UserName = configuration.GetValue<string>("Cap:RabbitMq:UserName");
option.Password = configuration.GetValue<string>("Cap:RabbitMq:Password");
option.Port = configuration.GetValue<int>("Cap:RabbitMq:Port");
});
capOptions.UseDashboard(options => { options.AuthorizationPolicy = AbpProCapPermissions.CapManagement.Cap; });
});
return service;
}
// /// <summary>
// /// 注册cap
// /// </summary>
// public static IServiceCollection AddAbpProCap(this IServiceCollection service)
// {
// var configuration = service.GetConfiguration();
// service.AddAbpCap(capOptions =>
// {
// capOptions.SetCapDbConnectionString(configuration["ConnectionStrings:Default"]);
// capOptions.UseEntityFramework<AbpProDbContext>();
// capOptions.UseRabbitMQ(option =>
// {
// option.HostName = configuration.GetValue<string>("Cap:RabbitMq:HostName");
// option.UserName = configuration.GetValue<string>("Cap:RabbitMq:UserName");
// option.Password = configuration.GetValue<string>("Cap:RabbitMq:Password");
// option.Port = configuration.GetValue<int>("Cap:RabbitMq:Port");
// });
// capOptions.UseDashboard(options => { options.AuthorizationPolicy = AbpProCapPermissions.CapManagement.Cap; });
// });
// return service;
// }
// /// <summary>
// /// 注册hangfire

Loading…
Cancel
Save