72 changed files with 297 additions and 392 deletions
@ -1,41 +1,41 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
||||
|
|
||||
public class LionAbpProLionAbpProCapDbProviderInfoProvider : ILionAbpProCapDbProviderInfoProvider, ITransientDependency |
public class AbpProAbpProCapDbProviderInfoProvider : IAbpProCapDbProviderInfoProvider, ITransientDependency |
||||
{ |
{ |
||||
protected ConcurrentDictionary<string, LionAbpProCapDbProviderInfo> CapDbProviderInfos { get; set; } = new(); |
protected ConcurrentDictionary<string, AbpProCapDbProviderInfo> CapDbProviderInfos { get; set; } = new(); |
||||
|
|
||||
public virtual LionAbpProCapDbProviderInfo GetOrNull(string dbProviderName) |
public virtual AbpProCapDbProviderInfo GetOrNull(string dbProviderName) |
||||
{ |
{ |
||||
return CapDbProviderInfos.GetOrAdd(dbProviderName, InternalGetOrNull); |
return CapDbProviderInfos.GetOrAdd(dbProviderName, InternalGetOrNull); |
||||
} |
} |
||||
|
|
||||
protected virtual LionAbpProCapDbProviderInfo InternalGetOrNull(string databaseProviderName) |
protected virtual AbpProCapDbProviderInfo InternalGetOrNull(string databaseProviderName) |
||||
{ |
{ |
||||
switch (databaseProviderName) |
switch (databaseProviderName) |
||||
{ |
{ |
||||
case "Microsoft.EntityFrameworkCore.SqlServer": |
case "Microsoft.EntityFrameworkCore.SqlServer": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.SqlServerCapTransaction, DotNetCore.CAP.SqlServer", |
"DotNetCore.CAP.SqlServerCapTransaction, DotNetCore.CAP.SqlServer", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.SqlServer"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.SqlServer"); |
||||
case "Npgsql.EntityFrameworkCore.PostgreSQL": |
case "Npgsql.EntityFrameworkCore.PostgreSQL": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.PostgreSqlCapTransaction, DotNetCore.CAP.PostgreSql", |
"DotNetCore.CAP.PostgreSqlCapTransaction, DotNetCore.CAP.PostgreSql", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.PostgreSQL"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.PostgreSQL"); |
||||
case "Pomelo.EntityFrameworkCore.MySql": |
case "Pomelo.EntityFrameworkCore.MySql": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.MySqlCapTransaction, DotNetCore.CAP.MySql", |
"DotNetCore.CAP.MySqlCapTransaction, DotNetCore.CAP.MySql", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.MySql"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.MySql"); |
||||
case "Oracle.EntityFrameworkCore": |
case "Oracle.EntityFrameworkCore": |
||||
case "Devart.Data.Oracle.Entity.EFCore": |
case "Devart.Data.Oracle.Entity.EFCore": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.OracleCapTransaction, DotNetCore.CAP.Oracle", |
"DotNetCore.CAP.OracleCapTransaction, DotNetCore.CAP.Oracle", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.Oracle"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.Oracle"); |
||||
case "Microsoft.EntityFrameworkCore.Sqlite": |
case "Microsoft.EntityFrameworkCore.Sqlite": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.SqliteCapTransaction, DotNetCore.CAP.Sqlite", |
"DotNetCore.CAP.SqliteCapTransaction, DotNetCore.CAP.Sqlite", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.Sqlite"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.Sqlite"); |
||||
case "Microsoft.EntityFrameworkCore.InMemory": |
case "Microsoft.EntityFrameworkCore.InMemory": |
||||
return new LionAbpProCapDbProviderInfo( |
return new AbpProCapDbProviderInfo( |
||||
"DotNetCore.CAP.InMemoryCapTransaction, DotNetCore.CAP.InMemoryStorage", |
"DotNetCore.CAP.InMemoryCapTransaction, DotNetCore.CAP.InMemoryStorage", |
||||
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.InMemoryStorage"); |
"Microsoft.EntityFrameworkCore.Storage.CapEFDbTransaction, DotNetCore.CAP.InMemoryStorage"); |
||||
default: |
default: |
||||
@ -1,12 +1,12 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
||||
|
|
||||
public class LionAbpProCapDbProviderInfo |
public class AbpProCapDbProviderInfo |
||||
{ |
{ |
||||
public Type CapTransactionType { get; } |
public Type CapTransactionType { get; } |
||||
|
|
||||
public Type CapEfDbTransactionType { get; } |
public Type CapEfDbTransactionType { get; } |
||||
|
|
||||
public LionAbpProCapDbProviderInfo(string capTransactionTypeName, string capEfDbTransactionTypeName) |
public AbpProCapDbProviderInfo(string capTransactionTypeName, string capEfDbTransactionTypeName) |
||||
{ |
{ |
||||
CapTransactionType = Type.GetType(capTransactionTypeName, false); |
CapTransactionType = Type.GetType(capTransactionTypeName, false); |
||||
CapEfDbTransactionType = Type.GetType(capEfDbTransactionTypeName, false); |
CapEfDbTransactionType = Type.GetType(capEfDbTransactionTypeName, false); |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace Lion.AbpPro.CAP.EntityFrameworkCore |
||||
|
{ |
||||
|
[DependsOn(typeof(AbpProCapModule))] |
||||
|
public class AbpProCapEntityFrameworkCoreModule : AbpModule |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,11 @@ |
|||||
using Lion.AbpPro.CAP.EntityFrameworkCore; |
|
||||
|
|
||||
// ReSharper disable once CheckNamespace
|
// ReSharper disable once CheckNamespace
|
||||
namespace Microsoft.Extensions.DependencyInjection |
namespace Microsoft.Extensions.DependencyInjection |
||||
{ |
{ |
||||
public static class LionAbpProCapOptionsExtensions |
public static class AbpProCapOptionsExtensions |
||||
{ |
{ |
||||
public static CapOptions SetCapDbConnectionString(this CapOptions options, string dbConnectionString) |
public static CapOptions SetCapDbConnectionString(this CapOptions options, string dbConnectionString) |
||||
{ |
{ |
||||
options.RegisterExtension(new LionAbpProEfCoreDbContextCapOptionsExtension |
options.RegisterExtension(new AbpProEfCoreDbContextCapOptionsExtension |
||||
{ |
{ |
||||
CapUsingDbConnectionString = dbConnectionString |
CapUsingDbConnectionString = dbConnectionString |
||||
}); |
}); |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
||||
|
|
||||
public class LionAbpProEfCoreDbContextCapOptions |
public class AbpProEfCoreDbContextCapOptions |
||||
{ |
{ |
||||
public string CapUsingDbConnectionString { get; set; } |
public string CapUsingDbConnectionString { get; set; } |
||||
} |
} |
||||
@ -1,12 +1,12 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
||||
|
|
||||
public class LionAbpProEfCoreDbContextCapOptionsExtension : ICapOptionsExtension |
public class AbpProEfCoreDbContextCapOptionsExtension : ICapOptionsExtension |
||||
{ |
{ |
||||
public string CapUsingDbConnectionString { get; init; } |
public string CapUsingDbConnectionString { get; init; } |
||||
|
|
||||
public void AddServices(IServiceCollection services) |
public void AddServices(IServiceCollection services) |
||||
{ |
{ |
||||
services.Configure<LionAbpProEfCoreDbContextCapOptions>(options => |
services.Configure<AbpProEfCoreDbContextCapOptions>(options => |
||||
{ |
{ |
||||
options.CapUsingDbConnectionString = CapUsingDbConnectionString; |
options.CapUsingDbConnectionString = CapUsingDbConnectionString; |
||||
}); |
}); |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
||||
|
|
||||
|
public interface IAbpProCapDbProviderInfoProvider |
||||
|
{ |
||||
|
AbpProCapDbProviderInfo GetOrNull(string dbProviderName); |
||||
|
} |
||||
@ -1,6 +0,0 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore; |
|
||||
|
|
||||
public interface ILionAbpProCapDbProviderInfoProvider |
|
||||
{ |
|
||||
LionAbpProCapDbProviderInfo GetOrNull(string dbProviderName); |
|
||||
} |
|
||||
@ -1,7 +0,0 @@ |
|||||
namespace Lion.AbpPro.CAP.EntityFrameworkCore |
|
||||
{ |
|
||||
[DependsOn(typeof(LionAbpProCapModule))] |
|
||||
public class LionAbpProCapEntityFrameworkCoreModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
} |
|
||||
@ -1,3 +1,11 @@ |
|||||
// Global using directives
|
// Global using directives
|
||||
|
|
||||
global using Volo.Abp.Authorization.Permissions; |
global using System.Text; |
||||
|
global using System.Text.Json; |
||||
|
global using DotNetCore.CAP.Messages; |
||||
|
global using DotNetCore.CAP.Serialization; |
||||
|
global using Lion.AbpPro.Localization; |
||||
|
global using Microsoft.Extensions.DependencyInjection.Extensions; |
||||
|
global using Volo.Abp.Authorization.Permissions; |
||||
|
global using Volo.Abp.Json; |
||||
|
global using Volo.Abp.Localization; |
||||
@ -0,0 +1,16 @@ |
|||||
|
namespace Lion.AbpPro.CAP; |
||||
|
|
||||
|
public class AbpProCapPermissionDefinitionProvider : PermissionDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IPermissionDefinitionContext context) |
||||
|
{ |
||||
|
var abpIdentityGroup = context.GetGroup(AbpProCapPermissions.CapManagement.Default); |
||||
|
|
||||
|
abpIdentityGroup.AddPermission(AbpProCapPermissions.CapManagement.Cap, L("Permission:Cap")); |
||||
|
} |
||||
|
|
||||
|
private static LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<AbpProLocalizationResource>(name); |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.CAP; |
namespace Lion.AbpPro.CAP; |
||||
|
|
||||
public static class LionAbpProCapPermissions |
public static class AbpProCapPermissions |
||||
{ |
{ |
||||
|
|
||||
public static class CapManagement |
public static class CapManagement |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.CAP; |
namespace Lion.AbpPro.CAP; |
||||
|
|
||||
public static class LionAbpProCapPublisherExtension |
public static class AbpProCapPublisherExtension |
||||
{ |
{ |
||||
public static IDisposable UseTransaction(this ICapPublisher capPublisher, ICapTransaction capTransaction) |
public static IDisposable UseTransaction(this ICapPublisher capPublisher, ICapTransaction capTransaction) |
||||
{ |
{ |
||||
@ -0,0 +1,13 @@ |
|||||
|
namespace Lion.AbpPro.CAP; |
||||
|
|
||||
|
public static class AbpProCapServiceCollectionExtensions |
||||
|
{ |
||||
|
public static ServiceConfigurationContext AddAbpCap(this ServiceConfigurationContext context, Action<CapOptions> capAction) |
||||
|
{ |
||||
|
context.Services.Replace(ServiceDescriptor.Transient<IUnitOfWork, AbpProCapUnitOfWork>()); |
||||
|
context.Services.Replace(ServiceDescriptor.Transient<UnitOfWork, AbpProCapUnitOfWork>()); |
||||
|
context.Services.AddTransient<AbpProCapUnitOfWork>(); |
||||
|
context.Services.AddCap(capAction); |
||||
|
return context; |
||||
|
} |
||||
|
} |
||||
@ -1,16 +1,10 @@ |
|||||
using System.Text; |
namespace Lion.AbpPro.CAP; |
||||
using System.Text.Json; |
|
||||
using DotNetCore.CAP.Messages; |
|
||||
using DotNetCore.CAP.Serialization; |
|
||||
using Volo.Abp.Json; |
|
||||
|
|
||||
namespace Lion.AbpPro.CAP; |
public class AbpProJsonSerializer : ISerializer, ISingletonDependency |
||||
|
|
||||
public class LionAbpProJsonSerializer : ISerializer, ISingletonDependency |
|
||||
{ |
{ |
||||
private readonly IJsonSerializer _jsonSerializer; |
private readonly IJsonSerializer _jsonSerializer; |
||||
|
|
||||
public LionAbpProJsonSerializer(IJsonSerializer jsonSerializer) |
public AbpProJsonSerializer(IJsonSerializer jsonSerializer) |
||||
{ |
{ |
||||
_jsonSerializer = jsonSerializer; |
_jsonSerializer = jsonSerializer; |
||||
} |
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.CAP; |
namespace Lion.AbpPro.CAP; |
||||
|
|
||||
public interface ILionAbpProCapTransactionApiFactory |
public interface IAbpProCapTransactionApiFactory |
||||
{ |
{ |
||||
Type TransactionApiType { get; } |
Type TransactionApiType { get; } |
||||
|
|
||||
@ -1,19 +0,0 @@ |
|||||
using Lion.AbpPro.Localization; |
|
||||
using Volo.Abp.Localization; |
|
||||
|
|
||||
namespace Lion.AbpPro.CAP; |
|
||||
|
|
||||
public class LionAbpProCapPermissionDefinitionProvider : PermissionDefinitionProvider |
|
||||
{ |
|
||||
public override void Define(IPermissionDefinitionContext context) |
|
||||
{ |
|
||||
var abpIdentityGroup = context.GetGroup(LionAbpProCapPermissions.CapManagement.Default); |
|
||||
|
|
||||
abpIdentityGroup.AddPermission(LionAbpProCapPermissions.CapManagement.Cap, L("Permission:Cap")); |
|
||||
} |
|
||||
|
|
||||
private static LocalizableString L(string name) |
|
||||
{ |
|
||||
return LocalizableString.Create<LionAbpProLocalizationResource>(name); |
|
||||
} |
|
||||
} |
|
||||
@ -1,23 +0,0 @@ |
|||||
using DotNetCore.CAP.Serialization; |
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
||||
|
|
||||
namespace Lion.AbpPro.CAP; |
|
||||
|
|
||||
public static class LionAbpProCapServiceCollectionExtensions |
|
||||
{ |
|
||||
public static ServiceConfigurationContext AddAbpCap( |
|
||||
this ServiceConfigurationContext context, |
|
||||
Action<CapOptions> capAction) |
|
||||
{ |
|
||||
// context.Services.AddSingleton<IConsumerServiceSelector, LionAbpProCapConsumerServiceSelector>();
|
|
||||
// context.Services.AddSingleton<IDistributedEventBus, LionAbpProCapDistributedEventBus>();
|
|
||||
// context.Services.AddSingleton<ISerializer, LionAbpProJsonSerializer>();
|
|
||||
|
|
||||
context.Services.Replace(ServiceDescriptor.Transient<IUnitOfWork, LionAbpProCapUnitOfWork>()); |
|
||||
context.Services.Replace(ServiceDescriptor.Transient<UnitOfWork, LionAbpProCapUnitOfWork>()); |
|
||||
context.Services.AddTransient<LionAbpProCapUnitOfWork>(); |
|
||||
|
|
||||
context.Services.AddCap(capAction); |
|
||||
return context; |
|
||||
} |
|
||||
} |
|
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.Cli.Github; |
namespace Lion.AbpPro.Cli.Github; |
||||
|
|
||||
public interface ILionAbpProManager |
public interface IAbpProManager |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// 获取最后一个版本
|
/// 获取最后一个版本
|
||||
@ -1,8 +1,8 @@ |
|||||
namespace Lion.AbpPro.Cli.Options; |
namespace Lion.AbpPro.Cli.Options; |
||||
|
|
||||
public class LionAbpProTemplateOptions |
public class AbpProTemplateOptions |
||||
{ |
{ |
||||
public LionAbpProTemplateOptions(string key, string name, string description, bool isSource = false) |
public AbpProTemplateOptions(string key, string name, string description, bool isSource = false) |
||||
{ |
{ |
||||
Key = key; |
Key = key; |
||||
Name = name; |
Name = name; |
||||
@ -0,0 +1,8 @@ |
|||||
|
// Global using directives
|
||||
|
|
||||
|
global using Microsoft.Extensions.DependencyInjection; |
||||
|
global using Serilog; |
||||
|
global using Serilog.Events; |
||||
|
global using Volo.Abp; |
||||
|
global using Volo.Abp.Autofac; |
||||
|
global using Volo.Abp.Modularity; |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace Lion.AbpPro.Core; |
||||
|
|
||||
|
[DependsOn(typeof(AbpProLocalizationModule))] |
||||
|
public class AbpProCoreModule : AbpModule |
||||
|
{ |
||||
|
} |
||||
@ -1,8 +0,0 @@ |
|||||
using Volo.Abp.Modularity; |
|
||||
|
|
||||
namespace Lion.AbpPro.Core; |
|
||||
|
|
||||
[DependsOn(typeof(LionAbpProLocalizationModule))] |
|
||||
public class LionAbpProCoreModule : AbpModule |
|
||||
{ |
|
||||
} |
|
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro.EntityFrameworkCore.Mysql; |
namespace Lion.AbpPro.EntityFrameworkCore.Mysql; |
||||
|
|
||||
[DependsOn(typeof(AbpEntityFrameworkCoreMySQLModule))] |
[DependsOn(typeof(AbpEntityFrameworkCoreMySQLModule))] |
||||
public class LionAbpProEntityFrameworkCoreMysqlModule : AbpModule |
public class AbpProEntityFrameworkCoreMysqlModule : AbpModule |
||||
{ |
{ |
||||
} |
} |
||||
@ -1,6 +1,6 @@ |
|||||
namespace Lion.AbpPro; |
namespace Lion.AbpPro; |
||||
|
|
||||
public class LionAbpProLocalizationConsts |
public class AbpProLocalizationConsts |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// 名称空间
|
/// 名称空间
|
||||
@ -0,0 +1,24 @@ |
|||||
|
namespace Lion.AbpPro; |
||||
|
|
||||
|
[DependsOn( |
||||
|
typeof(AbpAutofacModule), |
||||
|
typeof(AbpLocalizationModule) |
||||
|
)] |
||||
|
public class AbpProLocalizationModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<AbpVirtualFileSystemOptions>(options => { options.FileSets.AddEmbedded<AbpProLocalizationModule>(AbpProLocalizationConsts.NameSpace); }); |
||||
|
|
||||
|
Configure<AbpLocalizationOptions>(options => |
||||
|
{ |
||||
|
options.Resources |
||||
|
.Add<AbpProLocalizationResource>(AbpProLocalizationConsts.DefaultCultureName) |
||||
|
.AddVirtualJson(AbpProLocalizationConsts.DefaultLocalizationResourceVirtualPath); |
||||
|
|
||||
|
options.DefaultResourceType = typeof(AbpProLocalizationResource); |
||||
|
}); |
||||
|
|
||||
|
Configure<AbpExceptionLocalizationOptions>(options => { options.MapCodeNamespace(AbpProLocalizationConsts.NameSpace, typeof(AbpProLocalizationResource)); }); |
||||
|
} |
||||
|
} |
||||
@ -1,24 +0,0 @@ |
|||||
namespace Lion.AbpPro; |
|
||||
|
|
||||
[DependsOn( |
|
||||
typeof(AbpAutofacModule), |
|
||||
typeof(AbpLocalizationModule) |
|
||||
)] |
|
||||
public class LionAbpProLocalizationModule : AbpModule |
|
||||
{ |
|
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
|
||||
{ |
|
||||
Configure<AbpVirtualFileSystemOptions>(options => { options.FileSets.AddEmbedded<LionAbpProLocalizationModule>(LionAbpProLocalizationConsts.NameSpace); }); |
|
||||
|
|
||||
Configure<AbpLocalizationOptions>(options => |
|
||||
{ |
|
||||
options.Resources |
|
||||
.Add<LionAbpProLocalizationResource>(LionAbpProLocalizationConsts.DefaultCultureName) |
|
||||
.AddVirtualJson(LionAbpProLocalizationConsts.DefaultLocalizationResourceVirtualPath); |
|
||||
|
|
||||
options.DefaultResourceType = typeof(LionAbpProLocalizationResource); |
|
||||
}); |
|
||||
|
|
||||
Configure<AbpExceptionLocalizationOptions>(options => { options.MapCodeNamespace(LionAbpProLocalizationConsts.NameSpace, typeof(LionAbpProLocalizationResource)); }); |
|
||||
} |
|
||||
} |
|
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace Lion.AbpPro.Localization; |
||||
|
|
||||
|
[LocalizationResourceName("AbpProLocalizationResource")] |
||||
|
public class AbpProLocalizationResource |
||||
|
{ |
||||
|
|
||||
|
} |
||||
@ -1,7 +0,0 @@ |
|||||
namespace Lion.AbpPro.Localization; |
|
||||
|
|
||||
[LocalizationResourceName("LionAbpProLocalizationResource")] |
|
||||
public class LionAbpProLocalizationResource |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
@ -1,19 +1,18 @@ |
|||||
using Lion.AbpPro.Cli; |
using Lion.AbpPro.Cli; |
||||
|
using Lion.AbpPro.Cli.Options; |
||||
using Volo.Abp; |
using Volo.Abp; |
||||
using Volo.Abp.Autofac; |
|
||||
using Volo.Abp.Modularity; |
using Volo.Abp.Modularity; |
||||
using LionAbpProOptions = Lion.AbpPro.Cli.Options.LionAbpProOptions; |
|
||||
|
|
||||
namespace Lion.AbpPro.Core.Cli |
namespace Lion.AbpPro.Core.Cli |
||||
{ |
{ |
||||
[DependsOn(typeof(AbpTestBaseModule), |
[DependsOn(typeof(AbpTestBaseModule), |
||||
typeof(AbpProCliCoreModule))] |
typeof(AbpProCliCoreModule))] |
||||
public class LionAbpProCoreCliTestBaseModule : AbpModule |
public class AbpProCoreCliTestBaseModule : AbpModule |
||||
{ |
{ |
||||
public override void ConfigureServices(ServiceConfigurationContext context) |
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
{ |
{ |
||||
|
|
||||
Configure<LionAbpProOptions>(options => |
Configure<AbpProCliOptions>(options => |
||||
{ |
{ |
||||
options.Owner = "WangJunZzz"; |
options.Owner = "WangJunZzz"; |
||||
options.RepositoryId = "abp-vnext-pro"; |
options.RepositoryId = "abp-vnext-pro"; |
||||
@ -0,0 +1,32 @@ |
|||||
|
using Lion.AbpPro.Cli.Github; |
||||
|
using Shouldly; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Lion.AbpPro.Core.Cli; |
||||
|
|
||||
|
public sealed class AbpProManagerTests : AbpProCoreCliTestBase |
||||
|
{ |
||||
|
private readonly IAbpProManager _abpProManager; |
||||
|
|
||||
|
public AbpProManagerTests() |
||||
|
{ |
||||
|
_abpProManager = GetRequiredService<IAbpProManager>(); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public async Task GetLatestSourceCodeVersionAsync() |
||||
|
{ |
||||
|
var result= await _abpProManager.GetLatestSourceCodeVersionAsync(); |
||||
|
result.ShouldBe("7.2.2.3"); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public async Task CheckSourceCodeVersionAsync() |
||||
|
{ |
||||
|
var result= await _abpProManager.CheckSourceCodeVersionAsync("7.2.2.3"); |
||||
|
result.ShouldBe(true); |
||||
|
|
||||
|
var result1= await _abpProManager.CheckSourceCodeVersionAsync("1.2.2.3"); |
||||
|
result1.ShouldBe(false); |
||||
|
} |
||||
|
} |
||||
@ -1,32 +0,0 @@ |
|||||
using Lion.AbpPro.Cli.Github; |
|
||||
using Shouldly; |
|
||||
using Xunit; |
|
||||
|
|
||||
namespace Lion.AbpPro.Core.Cli; |
|
||||
|
|
||||
public sealed class LionAbpProManagerTests : LionAbpProCoreCliTestBase |
|
||||
{ |
|
||||
private readonly ILionAbpProManager _lionAbpProManager; |
|
||||
|
|
||||
public LionAbpProManagerTests() |
|
||||
{ |
|
||||
_lionAbpProManager = GetRequiredService<ILionAbpProManager>(); |
|
||||
} |
|
||||
|
|
||||
[Fact] |
|
||||
public async Task GetLatestSourceCodeVersionAsync() |
|
||||
{ |
|
||||
var result= await _lionAbpProManager.GetLatestSourceCodeVersionAsync(); |
|
||||
result.ShouldBe("7.2.2.3"); |
|
||||
} |
|
||||
|
|
||||
[Fact] |
|
||||
public async Task CheckSourceCodeVersionAsync() |
|
||||
{ |
|
||||
var result= await _lionAbpProManager.CheckSourceCodeVersionAsync("7.2.2.3"); |
|
||||
result.ShouldBe(true); |
|
||||
|
|
||||
var result1= await _lionAbpProManager.CheckSourceCodeVersionAsync("1.2.2.3"); |
|
||||
result1.ShouldBe(false); |
|
||||
} |
|
||||
} |
|
||||
Loading…
Reference in new issue