Skip to content

Commit

Permalink
240131
Browse files Browse the repository at this point in the history
  • Loading branch information
Tynab committed Jan 31, 2024
1 parent 2c116a1 commit 9b32562
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 39 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /yanlib
COPY ["lib/YANLib/YANLib.csproj", "lib/YANLib/"]
COPY ["host/YANLib.HttpApi.Host/YANLib.HttpApi.Host.csproj", "host/YANLib.HttpApi.Host/"]
Expand Down
15 changes: 7 additions & 8 deletions host/YANLib.HttpApi.Host/YANLibHttpApiHostModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Collections.Generic;
using System.Linq;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
Expand All @@ -38,8 +39,6 @@
using static Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus;
using static System.Convert;
using static System.StringSplitOptions;
using Volo.Abp.Account.Web;


#if DEBUG
using Microsoft.AspNetCore.Authentication.JwtBearer;
Expand All @@ -54,18 +53,18 @@
namespace YANLib;

[DependsOn(
typeof(YANLibHttpApiModule),
typeof(YANLibApplicationModule),
typeof(YANLibEntityFrameworkCoreModule),
typeof(AbpAutofacModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpHttpClientModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEventBusAzureModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpAccountWebOpenIddictModule)
typeof(YANLibHttpApiModule),
typeof(YANLibApplicationModule),
typeof(YANLibEntityFrameworkCoreModule)
)]
public class YANLibHttpApiHostModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
namespace YANLib;

[DependsOn(
typeof(YANLibDomainSharedModule),
typeof(AbpDddApplicationContractsModule),
typeof(AbpAuthorizationModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpAccountApplicationContractsModule)
typeof(AbpAccountApplicationContractsModule),
typeof(YANLibDomainSharedModule)
)]
public class YANLibApplicationContractsModule : AbpModule
{
Expand Down
10 changes: 5 additions & 5 deletions src/YANLib.Application/YANLibApplicationModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
namespace YANLib;

[DependsOn(
typeof(YANLibDomainModule),
typeof(YANLibApplicationContractsModule),
typeof(YANLibApplicationRedisModule),
typeof(AbpDddApplicationModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpAccountApplicationModule),
typeof(AbpAutoMapperModule),
typeof(AbpFluentValidationModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpAccountApplicationModule)
typeof(YANLibDomainModule),
typeof(YANLibApplicationContractsModule),
typeof(YANLibApplicationRedisModule)
)]
public class YANLibApplicationModule : AbpModule
{
Expand Down
4 changes: 2 additions & 2 deletions src/YANLib.Domain/YANLibDomainModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
namespace YANLib;

[DependsOn(
typeof(YANLibDomainSharedModule),
typeof(AbpDddDomainModule),
typeof(AbpIdentityDomainModule),
typeof(AbpBackgroundJobsDomainModule)
typeof(AbpBackgroundJobsDomainModule),
typeof(YANLibDomainSharedModule)
)]
public class YANLibDomainModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
namespace YANLib.EntityFrameworkCore;

[DependsOn(
typeof(YANLibDomainModule),
typeof(AbpEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpBackgroundJobsEntityFrameworkCoreModule)
typeof(AbpBackgroundJobsEntityFrameworkCoreModule),
typeof(YANLibDomainModule)
)]
public class YANLibEntityFrameworkCoreModule : AbpModule
{
Expand Down
4 changes: 2 additions & 2 deletions src/YANLib.HttpApi.Client/YANLibHttpApiClientModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
namespace YANLib;

[DependsOn(
typeof(YANLibApplicationContractsModule),
typeof(AbpHttpClientModule),
typeof(AbpIdentityHttpApiClientModule),
typeof(AbpAccountHttpApiClientModule)
typeof(AbpAccountHttpApiClientModule),
typeof(YANLibApplicationContractsModule)
)]
public class YANLibHttpApiClientModule : AbpModule
{
Expand Down
4 changes: 2 additions & 2 deletions src/YANLib.HttpApi/YANLibHttpApiModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
namespace YANLib;

[DependsOn(
typeof(YANLibApplicationContractsModule),
typeof(AbpAspNetCoreMvcModule),
typeof(AbpIdentityHttpApiModule),
typeof(AbpAccountHttpApiModule)
typeof(AbpAccountHttpApiModule),
typeof(YANLibApplicationContractsModule)
)]
public class YANLibHttpApiModule : AbpModule
{
Expand Down
4 changes: 2 additions & 2 deletions src/YANLib.MongoDB/MongoDB/YANLibMongoDbModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
namespace YANLib.MongoDB;

[DependsOn(
typeof(YANLibDomainModule),
typeof(AbpMongoDbModule),
typeof(AbpIdentityMongoDbModule)
typeof(AbpIdentityMongoDbModule),
typeof(YANLibDomainModule)
)]
public class YANLibMongoDbModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public async Task Initial_Data_Should_Contain_Admin_User()

// Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(u => u.UserName == "admin");
result.Items.ShouldContain(u => u.UserName == "yan");
}
}
8 changes: 4 additions & 4 deletions test/YANLib.Domain.Tests/Samples/SampleDomainTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public async Task Should_Set_Email_Of_A_User()

await WithUnitOfWorkAsync(async () =>
{
adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN");
_ = await _identityUserManager.SetEmailAsync(adminUser, "[email protected]");
adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("YAN");
_ = await _identityUserManager.SetEmailAsync(adminUser, "[email protected]");
_ = await _identityUserRepository.UpdateAsync(adminUser);
});

adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN");
adminUser.Email.ShouldBe("[email protected]");
adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("YAN");
adminUser.Email.ShouldBe("[email protected]");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public class SampleRepositoryTests : YANLibEntityFrameworkCoreTestBase
[Fact]
public async Task Should_Query_AppUser() => await WithUnitOfWorkAsync(async () =>
{
//Act
var adminUser = await (await _appUserRepository.GetQueryableAsync()).Where(u => u.UserName == "admin").FirstOrDefaultAsync();
// Act
var adminUser = await (await _appUserRepository.GetQueryableAsync()).Where(u => u.UserName == "yan").FirstOrDefaultAsync();

//Assert
// Assert
_ = adminUser.ShouldNotBeNull();
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace YANLib.EntityFrameworkCore;

[DependsOn(
typeof(AbpEntityFrameworkCoreSqliteModule),
typeof(YANLibEntityFrameworkCoreModule),
typeof(YANLibTestBaseModule),
typeof(AbpEntityFrameworkCoreSqliteModule)
typeof(YANLibTestBaseModule)
)]
public class YANLibEntityFrameworkCoreTestModule : AbpModule
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace YANLib.HttpApi.Client.ConsoleTestApp;

[DependsOn(
typeof(AbpAutofacModule),
typeof(YANLibHttpApiClientModule),
typeof(AbpHttpClientIdentityModelModule)
typeof(AbpHttpClientIdentityModelModule),
typeof(YANLibHttpApiClientModule)
)]
public class YANLibConsoleApiClientModule : AbpModule
{
Expand Down

0 comments on commit 9b32562

Please sign in to comment.