Browse Source

Initial commit

Added Shared Localization,Hosting,AspnetCore with default AuthServer
pull/1/head
Galip Tolga Erdem 5 years ago
parent
commit
f2837cacb4
  1. 48
      EShopOnAbp.sln
  2. 23
      apps/auth-server/EShopOnAbp.AuthServer.sln
  3. 26
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj
  4. 145
      apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs
  5. 46
      apps/auth-server/src/EShopOnAbp.AuthServer/Program.cs
  6. 28
      apps/auth-server/src/EShopOnAbp.AuthServer/Properties/launchSettings.json
  7. 19
      apps/auth-server/src/EShopOnAbp.AuthServer/Startup.cs
  8. 9
      apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Development.json
  9. 40
      apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.json
  10. 18
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj
  11. 16
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs
  12. 38
      shared/EShopOnAbp.Shared.Hosting.AspNetCore/SerilogConfigurationHelper.cs
  13. 20
      shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj
  14. 51
      shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs
  15. 23
      shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj
  16. 34
      shared/EShopOnAbp.Shared.Localization/EShopOnAbpSharedLocalizationModule.cs
  17. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/ar.json
  18. 5
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/de-DE.json
  19. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/en.json
  20. 5
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/es.json
  21. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/fi.json
  22. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/fr.json
  23. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/hi.json
  24. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/it.json
  25. 5
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/sl.json
  26. 7
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/tr.json
  27. 5
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/zh-Hans.json
  28. 10
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbpResource.cs

48
EShopOnAbp.sln

@ -0,0 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "apps", "apps", "{866DB6CC-FEA8-4CC2-A2E4-143537D197B6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gateways", "gateways", "{1484E912-DCF3-4568-A72C-4C7622104DB8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "services", "services", "{F415FFFD-E52D-4EBE-98DC-067C1EFFFFE3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{B8B59303-2178-459B-91A8-DF353044E090}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.AuthServer", "apps\auth-server\src\EShopOnAbp.AuthServer\EShopOnAbp.AuthServer.csproj", "{09F9A583-778D-4940-83B0-958C5D4E6D52}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.Shared.Hosting", "shared\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj", "{B473B411-0B14-47A9-B4BB-9F0F4E884C87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.Shared.Hosting.AspNetCore", "shared\EShopOnAbp.Shared.Hosting.AspNetCore\EShopOnAbp.Shared.Hosting.AspNetCore.csproj", "{6FCB66AF-6044-478D-B2A0-90F7E555C152}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EShopOnAbp.Shared.Localization", "shared\EShopOnAbp.Shared.Localization\EShopOnAbp.Shared.Localization.csproj", "{2B608875-8226-44E4-B93A-D475E11A7B80}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{09F9A583-778D-4940-83B0-958C5D4E6D52} = {866DB6CC-FEA8-4CC2-A2E4-143537D197B6}
{B473B411-0B14-47A9-B4BB-9F0F4E884C87} = {B8B59303-2178-459B-91A8-DF353044E090}
{6FCB66AF-6044-478D-B2A0-90F7E555C152} = {B8B59303-2178-459B-91A8-DF353044E090}
{2B608875-8226-44E4-B93A-D475E11A7B80} = {B8B59303-2178-459B-91A8-DF353044E090}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09F9A583-778D-4940-83B0-958C5D4E6D52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09F9A583-778D-4940-83B0-958C5D4E6D52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09F9A583-778D-4940-83B0-958C5D4E6D52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09F9A583-778D-4940-83B0-958C5D4E6D52}.Release|Any CPU.Build.0 = Release|Any CPU
{B473B411-0B14-47A9-B4BB-9F0F4E884C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B473B411-0B14-47A9-B4BB-9F0F4E884C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B473B411-0B14-47A9-B4BB-9F0F4E884C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B473B411-0B14-47A9-B4BB-9F0F4E884C87}.Release|Any CPU.Build.0 = Release|Any CPU
{6FCB66AF-6044-478D-B2A0-90F7E555C152}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FCB66AF-6044-478D-B2A0-90F7E555C152}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FCB66AF-6044-478D-B2A0-90F7E555C152}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FCB66AF-6044-478D-B2A0-90F7E555C152}.Release|Any CPU.Build.0 = Release|Any CPU
{2B608875-8226-44E4-B93A-D475E11A7B80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B608875-8226-44E4-B93A-D475E11A7B80}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B608875-8226-44E4-B93A-D475E11A7B80}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B608875-8226-44E4-B93A-D475E11A7B80}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

23
apps/auth-server/EShopOnAbp.AuthServer.sln

@ -0,0 +1,23 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthServer", "src\EShopOnAbp.AuthServer\EShopOnAbp.AuthServer.csproj", "{D3689DAD-F573-444F-9200-7B468F67FAA8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4A589F57-8AD7-4156-9B52-6464A4A6ABD2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{32416675-3364-4F9F-AC2F-23747B5D946A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D3689DAD-F573-444F-9200-7B468F67FAA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3689DAD-F573-444F-9200-7B468F67FAA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3689DAD-F573-444F-9200-7B468F67FAA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3689DAD-F573-444F-9200-7B468F67FAA8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D3689DAD-F573-444F-9200-7B468F67FAA8} = {4A589F57-8AD7-4156-9B52-6464A4A6ABD2}
EndGlobalSection
EndGlobal

26
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbp.AuthServer.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="5.0.*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" Version="4.3.3" />
<PackageReference Include="Volo.Abp.EventBus.RabbitMQ" Version="4.3.3" />
<PackageReference Include="Volo.Abp.BackgroundJobs.RabbitMQ" Version="4.3.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="4.3.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Account.Web.IdentityServer" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Account.Application" Version="4.3.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\shared\EShopOnAbp.Shared.Hosting.AspNetCore\EShopOnAbp.Shared.Hosting.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\..\shared\EShopOnAbp.Shared.Localization\EShopOnAbp.Shared.Localization.csproj" />
</ItemGroup>
</Project>

145
apps/auth-server/src/EShopOnAbp.AuthServer/EShopOnAbpAuthServerModule.cs

@ -0,0 +1,145 @@
using System;
using System.IO;
using System.Linq;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using StackExchange.Redis;
using Volo.Abp;
using Volo.Abp.Account;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.Auditing;
using Volo.Abp.BackgroundJobs.RabbitMQ;
using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Emailing;
using Volo.Abp.EventBus.RabbitMq;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.AuthServer
{
[DependsOn(
typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEventBusRabbitMqModule),
typeof(AbpBackgroundJobsRabbitMqModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule),
typeof(AbpAccountWebIdentityServerModule),
typeof(AbpAccountApplicationModule),
typeof(EShopOnAbpSharedHostingAspNetCoreModule),
typeof(EShopOnAbpSharedLocalizationModule)
// typeof(AdministrationServiceEntityFrameworkCoreModule),
// typeof(IdentityServiceEntityFrameworkCoreModule),
// typeof(SaasServiceEntityFrameworkCoreModule),
)]
public class EShopOnAbpAuthServerModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = true;
});
Configure<AbpAuditingOptions>(options =>
{
options.ApplicationName = "AuthServer";
});
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"].Split(','));
});
Configure<AbpDistributedCacheOptions>(options =>
{
options.KeyPrefix = "EShopOnAbp:";
});
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
context.Services
.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "EShopOnAbp-Protection-Keys");
context.Services.AddCors(options =>
{
options.AddDefaultPolicy(builder =>
{
builder
.WithOrigins(
configuration["App:CorsOrigins"]
.Split(",", StringSplitOptions.RemoveEmptyEntries)
.Select(o => o.Trim().RemovePostFix("/"))
.ToArray()
)
.WithAbpExposedHeaders()
.SetIsOriginAllowedToAllowWildcardSubdomains()
.AllowAnyHeader()
.AllowAnyMethod()
.AllowCredentials();
});
});
#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif
if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<EShopOnAbpSharedLocalizationModule>(Path.Combine(hostingEnvironment.ContentRootPath,
$"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}shared{Path.DirectorySeparatorChar}EShopOnAbp.Shared.Localization"));
});
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAbpRequestLocalization();
if (!env.IsDevelopment())
{
app.UseErrorPage();
}
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseCors();
// app.UseHttpMetrics();
app.UseAuthentication();
app.UseMultiTenancy();
app.UseAbpSerilogEnrichers();
app.UseUnitOfWork();
app.UseIdentityServer();
app.UseAuthorization();
app.UseAuditing();
app.UseConfiguredEndpoints(endpoints =>
{
// endpoints.MapMetrics();
});
}
}
}

46
apps/auth-server/src/EShopOnAbp.AuthServer/Program.cs

@ -0,0 +1,46 @@
using System;
using System.Threading.Tasks;
using EShopOnAbp.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Serilog;
namespace EShopOnAbp.AuthServer
{
public class Program
{
public static async Task<int> Main(string[] args)
{
var assemblyName = typeof(Program).Assembly.GetName().Name;
SerilogConfigurationHelper.Configure(assemblyName);
try
{
Log.Information($"Starting {assemblyName}.");
await CreateHostBuilder(args).Build().RunAsync();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
internal static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(build =>
{
build.AddJsonFile("appsettings.secrets.json", optional: true);
})
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); })
.UseAutofac()
.UseSerilog();
}
}

28
apps/auth-server/src/EShopOnAbp.AuthServer/Properties/launchSettings.json

@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44330",
"sslPort": 44330
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"AuthServer": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:44330",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

19
apps/auth-server/src/EShopOnAbp.AuthServer/Startup.cs

@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace EShopOnAbp.AuthServer
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddApplication<EShopOnAbpAuthServerModule>();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.InitializeApplication();
}
}
}

9
apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.Development.json

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

40
apps/auth-server/src/EShopOnAbp.AuthServer/appsettings.json

@ -0,0 +1,40 @@
{
"App": {
"SelfUrl": "https://localhost:44330",
"CorsOrigins": "https://*.EShopOnAbp.com,http://localhost:4200,https://localhost:44307,https://localhost:44302,https://localhost:44325,https://localhost:44353",
"RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"IdentityService": "Server=localhost,1434;Database=MyProjectName_Identity;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true",
"AdministrationService": "Server=localhost,1434;Database=MyProjectName_Administration;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true",
"SaasService": "Server=localhost,1434;Database=MyProjectName_Saas;User Id=sa;password=myPassw0rd;MultipleActiveResultSets=true"
},
"StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8"
},
"Redis": {
"Configuration": "localhost:6379"
},
"RabbitMQ": {
"Connections": {
"Default": {
"HostName": "localhost"
}
},
"EventBus": {
"ClientName": "EShopOnAbp_AuthServer",
"ExchangeName": "EShopOnAbp"
}
},
"ElasticSearch": {
"Url": "http://localhost:9200"
}
}

18
shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbp.Shared.Hosting.AspNetCore.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>EShopOnAbp.Shared.Hosting.AspNetCore</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<!-- <PackageReference Include="Serilog.Sinks.ElasticSearch" Version="8.4.1" />-->
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="4.3.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj" />
</ItemGroup>
</Project>

16
shared/EShopOnAbp.Shared.Hosting.AspNetCore/EShopOnAbpSharedHostingAspNetCoreModule.cs

@ -0,0 +1,16 @@
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Modularity;
namespace EShopOnAbp.Shared.Hosting.AspNetCore
{
[DependsOn(
typeof(EShopOnAbpSharedHostingModule),
typeof(AbpAspNetCoreSerilogModule)
)]
public class EShopOnAbpSharedHostingAspNetCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}
}

38
shared/EShopOnAbp.Shared.Hosting.AspNetCore/SerilogConfigurationHelper.cs

@ -0,0 +1,38 @@
using Serilog;
using Serilog.Events;
namespace EShopOnAbp.Shared.Hosting.AspNetCore
{
public static class SerilogConfigurationHelper
{
public static void Configure(string applicationName)
{
// var configuration = new ConfigurationBuilder()
// .SetBasePath(Directory.GetCurrentDirectory())
// .AddJsonFile("appsettings.json")
// .AddEnvironmentVariables()
// .Build();
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.Enrich.WithProperty("Application", $"{applicationName}")
.WriteTo.Async(c => c.File("Logs/logs.txt"))
// .WriteTo.Elasticsearch(
// new ElasticsearchSinkOptions(new Uri(configuration["ElasticSearch:Url"]))
// {
// AutoRegisterTemplate = true,
// AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
// IndexFormat = "MyProjectName-log-{0:yyyy.MM}"
// })
.WriteTo.Async(c => c.Console())
.CreateLogger();
}
}
}

20
shared/EShopOnAbp.Shared.Hosting/EShopOnAbp.Shared.Hosting.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EShopOnAbp.Shared.Hosting</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Autofac" Version="4.3.3" />
<PackageReference Include="Volo.Abp.Data" Version="4.3.3" />
</ItemGroup>
</Project>

51
shared/EShopOnAbp.Shared.Hosting/EShopOnAbpSharedHostingModule.cs

@ -0,0 +1,51 @@
using Volo.Abp.Autofac;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
namespace EShopOnAbp.Shared.Hosting
{
[DependsOn(
typeof(AbpAutofacModule),
typeof(AbpDataModule)
)]
public class EShopOnAbpSharedHostingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
ConfigureDatabaseConnections();
}
private void ConfigureDatabaseConnections()
{
Configure<AbpDbConnectionOptions>(options =>
{
// options.Databases.Configure("SaasService", database =>
// {
// database.MappedConnections.Add("Saas");
// database.IsUsedByTenants = false;
// });
//
// options.Databases.Configure("AdministrationService", database =>
// {
// database.MappedConnections.Add("AbpAuditLogging");
// database.MappedConnections.Add("AbpPermissionManagement");
// database.MappedConnections.Add("AbpSettingManagement");
// database.MappedConnections.Add("AbpFeatureManagement");
// database.MappedConnections.Add("AbpLanguageManagement");
// database.MappedConnections.Add("TextTemplateManagement");
// database.MappedConnections.Add("AbpBlobStoring");
// });
//
// options.Databases.Configure("IdentityService", database =>
// {
// database.MappedConnections.Add("AbpIdentity");
// database.MappedConnections.Add("AbpIdentityServer");
// });
//
// options.Databases.Configure("ProductService", database =>
// {
// database.MappedConnections.Add("ProductService");
// });
});
}
}
}

23
shared/EShopOnAbp.Shared.Localization/EShopOnAbp.Shared.Localization.csproj

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<RootNamespace>EShopOnAbp</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.*" />
<PackageReference Include="Volo.Abp.Validation" Version="4.3.3" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\EShopOnAbp\*.json" />
<Content Remove="Localization\EShopOnAbp\*.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Localization" />
</ItemGroup>
</Project>

34
shared/EShopOnAbp.Shared.Localization/EShopOnAbpSharedLocalizationModule.cs

@ -0,0 +1,34 @@
using EShopOnAbp.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp
{
[DependsOn(
typeof(AbpValidationModule)
)]
public class EShopOnAbpSharedLocalizationModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<EShopOnAbpSharedLocalizationModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<EShopOnAbpResource>("en")
.AddBaseTypes(
typeof(AbpValidationResource)
).AddVirtualJson("/Localization/EShopOnAbp");
options.DefaultResourceType = typeof(EShopOnAbpResource);
});
}
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/ar.json

@ -0,0 +1,7 @@
{
"culture": "ar",
"texts": {
"Menu:Home": "منزل، بيت",
"Login": "تسجيل الدخول"
}
}

5
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/de-DE.json

@ -0,0 +1,5 @@
{
"culture": "de-DE",
"texts": {
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Menu:Home": "Home",
"Login": "Login"
}
}

5
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/es.json

@ -0,0 +1,5 @@
{
"culture": "es",
"texts": {
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/fi.json

@ -0,0 +1,7 @@
{
"culture": "fi",
"texts": {
"Menu:Home": "Koti",
"Login": "Kirjaudu sisään"
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/fr.json

@ -0,0 +1,7 @@
{
"culture": "fr",
"texts": {
"Menu:Home": "Acceuil",
"Login": "Connexion"
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/hi.json

@ -0,0 +1,7 @@
{
"culture": "hi",
"texts": {
"Menu:Home": "घर",
"Login": "लॉग इन करें"
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/it.json

@ -0,0 +1,7 @@
{
"culture": "it",
"texts": {
"Menu:Home": "Home",
"Login": "Login"
}
}

5
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/sl.json

@ -0,0 +1,5 @@
{
"culture": "sl",
"texts": {
}
}

7
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/tr.json

@ -0,0 +1,7 @@
{
"culture": "tr",
"texts": {
"Menu:Home": "Ana Sayfa",
"Login": "Giriş"
}
}

5
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/zh-Hans.json

@ -0,0 +1,5 @@
{
"culture": "zh-Hans",
"texts": {
}
}

10
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbpResource.cs

@ -0,0 +1,10 @@
using Volo.Abp.Localization;
namespace EShopOnAbp.Localization
{
[LocalizationResourceName("EShopOnAbp")]
public class EShopOnAbpResource
{
}
}
Loading…
Cancel
Save