This commit is contained in:
2023-07-28 21:18:18 +03:00
parent 5ecefe5756
commit 90f0386bfe
53 changed files with 3067 additions and 267 deletions
+30 -12
View File
@@ -42,16 +42,28 @@ using MyOffice.Services.Currency;
using Services.Account;
using Services.Item;
using MyOffice.Services.Dashboard;
using Services.Account.Domain;
using MyOffice.Services.Identity;
using AutoMapper;
using Models.Motion;
using MyOffice.Services.Account.Domain;
using MyOffice.Services.Mapper;
//TODO: Data.Model only Repository and Service, response <-> mapper <-> web <-> mapper <-> service <-> repository
//TODO: Project management
//TODO: Model names. Controller = xxxRequest/xxxResponse. Service xxxInput/xxxOutput.
//TODO: Validate string as Guid when id
//TODO: Logging
//TODO: Test back
//TODO: Test front
//TODO: Test DB ???
//TODO: Email confirmation
//TODO: Password recovery
//TODO: Account sharing
//TODO: /dashboard/dashboard -> /dashboard/main or /dashboard
//TODO: SPA load categories twice menu + setting (cache)
//TODO: SPA update account category -> update menu
//TODO: Response model from base type
//TODO: XXXResult -> XXXStatus
//TODO: SPA isAllowDelete -> allowDelete (remove is)
public class Program
{
@@ -79,6 +91,12 @@ public class Program
//File Logger
builder.Logging.AddFile(builder.Configuration.GetSection("Logging"));
builder.Services.Configure<LoggerFilterOptions>(options =>
{
//options.AddFilter("IdentityServer4", LogLevel.Warning); // or LogLevel.None to completely disable
options.AddFilter("IdentityServer4", LogLevel.None); // or LogLevel.None to completely disable
});
// shared configuration
builder.Configuration.AddConfiguration(SharedConfiguration.CreateConfigurationContainer());
@@ -180,9 +198,8 @@ public class Program
o.UserInteraction = new UserInteractionOptions()
{
LoginUrl = "/authentication/signin",
LoginReturnUrlParameter = "returnUrl"
LoginReturnUrlParameter = "returnUrl",
};
//o.IssuerUri = "http://localhost:9300";
})
.AddSigningCredential(CreateSigningCredential(builder))
.AddPersistedGrantStore<PersistedGrantStore>()
@@ -222,14 +239,15 @@ public class Program
private static void AddMapping(WebApplicationBuilder builder)
{
builder.Services.AddSingleton(provider => new MapperConfiguration(cfg =>
{
cfg.AddProfile(new AccountServiceProfile());
cfg.AddProfile(new ViewModelProfile());
cfg.AddProfile(new AccountViewModelProfile(provider.CreateScope().ServiceProvider.GetService<IContextProvider>()!));
cfg.AddProfile(new AccountControllerProfile());
}).CreateMapper());
builder.Services.AddAutoMapper(
c =>
{
c.AllowNullCollections = true;
c.AllowNullDestinationValues = true;
},
typeof(AccountViewModelProfile),
typeof(AccountServiceProfile)
);
}
private static void AddRepositories(WebApplicationBuilder builder)