Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email settings to setting-management #7669

Merged
merged 2 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ modules/blog/app/Volo.BlogTestApp/Logs/*.*
modules/blogging/app/Volo.BloggingTestApp/Logs/*.*
modules/blogging/app/Volo.BloggingTestApp/wwwroot/files/*.*
modules/docs/app/VoloDocs.Web/Logs/*.*
modules/setting-management/app/Volo.Abp.SettingManagement.DemoApp/Logs/*.*
templates/module/app/MyCompanyName.MyProjectName.DemoApp/Logs/*.*
templates/mvc/src/MyCompanyName.MyProjectName.Web/Logs/*.*

Expand Down
37 changes: 37 additions & 0 deletions modules/setting-management/Volo.Abp.SettingManagement.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.Blazor", "src\Volo.Abp.SettingManagement.Blazor\Volo.Abp.SettingManagement.Blazor.csproj", "{BDF54E3C-C262-406E-8060-84C423335BDD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.Application", "src\Volo.Abp.SettingManagement.Application\Volo.Abp.SettingManagement.Application.csproj", "{30798284-C33B-49D8-91A7-B379D8166F69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.Application.Contracts", "src\Volo.Abp.SettingManagement.Application.Contracts\Volo.Abp.SettingManagement.Application.Contracts.csproj", "{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.HttpApi", "src\Volo.Abp.SettingManagement.HttpApi\Volo.Abp.SettingManagement.HttpApi.csproj", "{BCE3E834-B90B-469A-B274-74D401FAFD6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.HttpApi.Client", "src\Volo.Abp.SettingManagement.HttpApi.Client\Volo.Abp.SettingManagement.HttpApi.Client.csproj", "{F3126FDD-A574-4940-AE06-78898E2DE98F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "app", "app", "{D3222BEC-EDCE-4509-9A19-36C43C9A59FB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.DemoApp", "app\Volo.Abp.SettingManagement.DemoApp\Volo.Abp.SettingManagement.DemoApp.csproj", "{8488F380-83DD-4209-80B7-87ACAB83A052}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -73,6 +85,26 @@ Global
{BDF54E3C-C262-406E-8060-84C423335BDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDF54E3C-C262-406E-8060-84C423335BDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDF54E3C-C262-406E-8060-84C423335BDD}.Release|Any CPU.Build.0 = Release|Any CPU
{30798284-C33B-49D8-91A7-B379D8166F69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{30798284-C33B-49D8-91A7-B379D8166F69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{30798284-C33B-49D8-91A7-B379D8166F69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{30798284-C33B-49D8-91A7-B379D8166F69}.Release|Any CPU.Build.0 = Release|Any CPU
{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD}.Release|Any CPU.Build.0 = Release|Any CPU
{BCE3E834-B90B-469A-B274-74D401FAFD6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BCE3E834-B90B-469A-B274-74D401FAFD6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BCE3E834-B90B-469A-B274-74D401FAFD6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BCE3E834-B90B-469A-B274-74D401FAFD6E}.Release|Any CPU.Build.0 = Release|Any CPU
{F3126FDD-A574-4940-AE06-78898E2DE98F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3126FDD-A574-4940-AE06-78898E2DE98F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3126FDD-A574-4940-AE06-78898E2DE98F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3126FDD-A574-4940-AE06-78898E2DE98F}.Release|Any CPU.Build.0 = Release|Any CPU
{8488F380-83DD-4209-80B7-87ACAB83A052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8488F380-83DD-4209-80B7-87ACAB83A052}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8488F380-83DD-4209-80B7-87ACAB83A052}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8488F380-83DD-4209-80B7-87ACAB83A052}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -88,6 +120,11 @@ Global
{DF76DE74-1029-4FEA-8ADF-3C5636944757} = {7E8D2943-ADE7-4C89-8048-0780CE07E0E0}
{AF6BE46D-AC88-4DEF-BBEC-F60A00847D43} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{BDF54E3C-C262-406E-8060-84C423335BDD} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{30798284-C33B-49D8-91A7-B379D8166F69} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{BE6CB9AD-889C-4D4D-AD2C-6571689F99DD} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{BCE3E834-B90B-469A-B274-74D401FAFD6E} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{F3126FDD-A574-4940-AE06-78898E2DE98F} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA}
{8488F380-83DD-4209-80B7-87ACAB83A052} = {D3222BEC-EDCE-4509-9A19-36C43C9A59FB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {24B3A486-E7CA-4AA5-B76F-27D351A97E59}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;

namespace Volo.Abp.SettingManagement.DemoApp
{
public class DemoAppDbContext: AbpDbContext<DemoAppDbContext>
{
public DemoAppDbContext(DbContextOptions<DemoAppDbContext> options)
: base(options)
{

}

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureIdentity();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System.IO;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;

namespace Volo.Abp.SettingManagement.DemoApp
{
public class DemoAppDbContextFactory : IDesignTimeDbContextFactory<DemoAppDbContext>
{
public DemoAppDbContext CreateDbContext(string[] args)
{
var configuration = BuildConfiguration();

var builder = new DbContextOptionsBuilder<DemoAppDbContext>()
.UseSqlServer(configuration.GetConnectionString("Default"));

return new DemoAppDbContext(builder.Options);
}

private static IConfigurationRoot BuildConfiguration()
{
var builder = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false);

return builder.Build();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.OpenApi.Models;
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.Autofac;
using Volo.Abp.Data;
using Volo.Abp.Emailing;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Identity.Web;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.Identity;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.Web;
using Volo.Abp.Threading;
using Volo.Abp.VirtualFileSystem;

namespace Volo.Abp.SettingManagement.DemoApp
{
[DependsOn(
typeof(AbpSettingManagementWebModule),
typeof(AbpSettingManagementApplicationModule),
typeof(AbpAutofacModule),
typeof(AbpAccountWebModule),
typeof(AbpAccountApplicationModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementApplicationModule),
typeof(AbpIdentityWebModule),
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementDomainIdentityModule),
typeof(AbpAspNetCoreMvcUiBasicThemeModule)
)]
public class DemoAppModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();

#if DEBUG
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>());
#endif

Configure<AbpDbContextOptions>(options =>
{
options.UseSqlServer();
});

if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.ReplaceEmbeddedByPhysical<AbpSettingManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Abp.SettingManagement.Web", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpSettingManagementDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Abp.SettingManagement.Domain", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpSettingManagementApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Abp.SettingManagement.Application", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpSettingManagementApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Volo.Abp.SettingManagement.Application.Contracts", Path.DirectorySeparatorChar)));
});
}

context.Services.AddSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "AbpSettingManagement API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
});

Configure<AbpLocalizationOptions>(options =>
{
options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
});

Configure<AbpMultiTenancyOptions>(options =>
{
options.IsEnabled = true;
});
}

public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();

if (context.GetEnvironment().IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
app.UseHsts();
}

app.UseHttpsRedirection();
app.UseVirtualFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseMultiTenancy();
app.UseAbpRequestLocalization();

app.UseSwagger();
app.UseSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "SettingManagement APP API");
});

app.UseConfiguredEndpoints();

using (var scope = context.ServiceProvider.CreateScope())
{
AsyncHelper.RunSync(async () =>
{
await scope.ServiceProvider
.GetRequiredService<IDataSeeder>()
.SeedAsync();
});
}
}
}
}