Skip to content

Commit

Permalink
Merge pull request #65 from EasyAbp/abp-7.3
Browse files Browse the repository at this point in the history
Upgrade to ABP 7.3.0
  • Loading branch information
gdlcf88 authored Jul 24, 2023
2 parents 7828ea9 + 6144c07 commit dfb356c
Show file tree
Hide file tree
Showing 57 changed files with 224 additions and 99 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>

<AbpVersion>7.2.1</AbpVersion>
<EasyAbpAbpWeChatModuleVersion>2.5.0</EasyAbpAbpWeChatModuleVersion>
<AbpVersion>7.3.0</AbpVersion>
<EasyAbpAbpWeChatModuleVersion>2.7.0</EasyAbpAbpWeChatModuleVersion>

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.7.0-preview.2</Version>
<Version>2.7.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain.Shared" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.Validation" Version="$(AbpVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Volo.Abp.Modularity;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using EasyAbp.PaymentService.Prepayment.Localization;
using Volo.Abp.Localization.ExceptionHandling;
Expand All @@ -9,7 +10,8 @@
namespace EasyAbp.PaymentService.Prepayment
{
[DependsOn(
typeof(AbpValidationModule)
typeof(AbpValidationModule),
typeof(AbpDddDomainSharedModule)
)]
public class PaymentServicePrepaymentDomainSharedModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
using WithdrawalRequests;

namespace EasyAbp.PaymentService.Prepayment.EntityFrameworkCore
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using Microsoft.EntityFrameworkCore;
using EasyAbp.PaymentService.Prepayment.WithdrawalRequests;

namespace EasyAbp.PaymentService.Prepayment.WithdrawalRequests
namespace WithdrawalRequests
{
public static class WithdrawalRequestEfCoreQueryableExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using EasyAbp.PaymentService.Prepayment.EntityFrameworkCore;
using EasyAbp.PaymentService.Prepayment.WithdrawalRequests;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace EasyAbp.PaymentService.Prepayment.WithdrawalRequests
namespace WithdrawalRequests
{
public class WithdrawalRequestRepository : EfCoreRepository<IPaymentServicePrepaymentDbContext, WithdrawalRequest, Guid>, IWithdrawalRequestRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@page
@using Microsoft.Extensions.Localization
@using EasyAbp.PaymentService.Prepayment.Localization
@model EasyAbp.PaymentService.Prepayment.Web.Pages.Prepayment.IndexModel
@model EasyAbp.PaymentService.Prepayment.Web.Pages.PaymentService.Prepayment.IndexModel
@inject IStringLocalizer<PrepaymentResource> L
@{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace EasyAbp.PaymentService.Prepayment.Web.Pages.Prepayment
namespace EasyAbp.PaymentService.Prepayment.Web.Pages.PaymentService.Prepayment
{
public class IndexModel : PrepaymentPageModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Microsoft.Extensions.Hosting;
using System.Threading;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Volo.Abp;

namespace EasyAbp.PaymentService.Prepayment.HttpApi.Client.ConsoleTestApp
namespace EasyAbp.PaymentService.Prepayment
{
public class ConsoleTestAppHostedService : IHostedService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace EasyAbp.PaymentService.Prepayment.HttpApi.Client.ConsoleTestApp
namespace EasyAbp.PaymentService.Prepayment
{
class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Mongo2Go" Version="3.1.3" />
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" />
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<ProjectReference Include="..\..\src\EasyAbp.PaymentService.Prepayment.MongoDB\EasyAbp.PaymentService.Prepayment.MongoDB.csproj" />
<ProjectReference Include="..\EasyAbp.PaymentService.Prepayment.TestBase\EasyAbp.PaymentService.Prepayment.TestBase.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
using System;
using Mongo2Go;
using EphemeralMongo;

namespace EasyAbp.PaymentService.Prepayment.MongoDB
{
public class MongoDbFixture : IDisposable
{
private static readonly MongoDbRunner MongoDbRunner;
public static readonly string ConnectionString;
public readonly static IMongoRunner MongoDbRunner;

static MongoDbFixture()
{
MongoDbRunner = MongoDbRunner.Start();
ConnectionString = MongoDbRunner.ConnectionString;
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
{
UseSingleNodeReplicaSet = true
});
}

public static string GetRandomConnectionString()
{
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
}

public static string GetConnectionString(string databaseName)
{
var stringArray = MongoDbRunner.ConnectionString.Split('?');
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
return connectionString;
}

public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ public class PrepaymentMongoDbTestModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') +
"Db_" +
Guid.NewGuid().ToString("N");

Configure<AbpDbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = connectionString;
options.ConnectionStrings.Default = MongoDbFixture.GetRandomConnectionString();
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain.Shared" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.Validation" Version="$(AbpVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Volo.Abp.Modularity;
using Volo.Abp.Domain;
using Volo.Abp.Modularity;
using Volo.Abp.Localization;
using EasyAbp.PaymentService.WeChatPay.Localization;
using Volo.Abp.Localization.ExceptionHandling;
Expand All @@ -9,7 +10,8 @@
namespace EasyAbp.PaymentService.WeChatPay
{
[DependsOn(
typeof(AbpValidationModule)
typeof(AbpValidationModule),
typeof(AbpDddDomainSharedModule)
)]
public class PaymentServiceWeChatPayDomainSharedModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using EasyAbp.PaymentService;
using EasyAbp.PaymentService.WeChatPay;
using Volo.Abp.Modularity;
using Volo.Abp.Modularity;

namespace EasyAbp.PaymentService.WeChatPay;

[DependsOn(
typeof(PaymentServiceApplicationModule),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* Inherit from this class for your application layer tests.
* See SampleAppService_Tests for example.
*/
namespace EasyAbp.PaymentService.WeChatPay;

public abstract class WeChatPayApplicationTestBase : WeChatPayTestBase<PaymentServiceWeChatPayApplicationTestModule>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* You can switch to MongoDB, however your domain tests should be
* database independent anyway.
*/
namespace EasyAbp.PaymentService.WeChatPay;

[DependsOn(
typeof(PaymentServiceEntityFrameworkCoreTestModule),
typeof(PaymentServiceWeChatPayEntityFrameworkCoreTestModule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/* Inherit from this class for your domain layer tests.
* See SampleManager_Tests for example.
*/
namespace EasyAbp.PaymentService.WeChatPay;

public abstract class WeChatPayDomainTestBase : WeChatPayTestBase<PaymentServiceWeChatPayDomainTestModule>
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityModel;

namespace EasyAbp.PaymentService.WeChatPay;

public class ClientDemoService : ITransientDependency
{
private readonly IIdentityModelAuthenticationService _authenticationService;
Expand All @@ -27,18 +29,18 @@ public async Task RunAsync()
}

/* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy
* feature. It is just simple as calling a local service method.
* Authorization and HTTP request details are handled by the ABP framework.
*/
* feature. It is just simple as calling a local service method.
* Authorization and HTTP request details are handled by the ABP framework.
*/
private async Task TestWithDynamicProxiesAsync()
{
Console.WriteLine();
Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****");
}

/* Shows how to use HttpClient to perform a request to the HTTP API.
* It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens.
*/
* It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens.
*/
private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync()
{
Console.WriteLine();
Expand Down Expand Up @@ -81,9 +83,9 @@ private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(
}

/* Shows how to use HttpClient to perform a request to the HTTP API.
* It obtains access token using IdentityServer's API. See its documentation:
* https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html
*/
* It obtains access token using IdentityServer's API. See its documentation:
* https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html
*/
private async Task TestAllManuallyAsync()
{
Console.WriteLine();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using Microsoft.Extensions.Hosting;
using Volo.Abp;

namespace EasyAbp.PaymentService.WeChatPay;

public class ConsoleTestAppHostedService : IHostedService
{
public async Task StartAsync(CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using EasyAbp.PaymentService.WeChatPay;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Modularity;

namespace EasyAbp.PaymentService.WeChatPay;

[DependsOn(
typeof(PaymentServiceWeChatPayHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace EasyAbp.PaymentService.WeChatPay;

class Program
{
static async Task Main(string[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Mongo2Go" Version="3.1.3" />
<PackageReference Include="EphemeralMongo.Core" Version="1.1.0" />
<PackageReference Include="EphemeralMongo6.runtime.linux-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Linux'))" />
<PackageReference Include="EphemeralMongo6.runtime.osx-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
<PackageReference Include="EphemeralMongo6.runtime.win-x64" Version="1.1.0" Condition="$([MSBuild]::IsOSPlatform('Windows'))" />
<ProjectReference Include="..\..\src\EasyAbp.PaymentService.WeChatPay.MongoDB\EasyAbp.PaymentService.WeChatPay.MongoDB.csproj" />
<ProjectReference Include="..\EasyAbp.PaymentService.WeChatPay.TestBase\EasyAbp.PaymentService.WeChatPay.TestBase.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using EphemeralMongo;

namespace EasyAbp.PaymentService.WeChatPay.MongoDB
{
public class MongoDbFixture : IDisposable
{
public readonly static IMongoRunner MongoDbRunner;

static MongoDbFixture()
{
MongoDbRunner = MongoRunner.Run(new MongoRunnerOptions
{
UseSingleNodeReplicaSet = true
});
}

public static string GetRandomConnectionString()
{
return GetConnectionString("Db_" + Guid.NewGuid().ToString("N"));
}

public static string GetConnectionString(string databaseName)
{
var stringArray = MongoDbRunner.ConnectionString.Split('?');
var connectionString = stringArray[0].EnsureEndsWith('/') + databaseName + "/?" + stringArray[1];
return connectionString;
}

public void Dispose()
{
MongoDbRunner?.Dispose();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Xunit;

namespace EasyAbp.PaymentService.WeChatPay.MongoDB
{
[CollectionDefinition(Name)]
public class MongoTestCollection : ICollectionFixture<MongoDbFixture>
{
public const string Name = "MongoDB Collection";
}
}
Loading

0 comments on commit dfb356c

Please sign in to comment.