Commit 92f7ddf3 authored by hasan khaddour's avatar hasan khaddour

Refactor domain architecture

parent 6a82d6a4
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace PSManagement.Api.Controllers
{
[Route("api/[controller]")]
[ApiController]
[Authorize]
public class HomeController : ControllerBase
{
[HttpGet]
public IActionResult Get()
{
return Ok( new { message = "success" });
}
}
}
...@@ -36,7 +36,7 @@ namespace PSManagement.Api ...@@ -36,7 +36,7 @@ namespace PSManagement.Api
.AddPresentation() .AddPresentation()
.AddApplication() .AddApplication()
.AddPersistence(Configuration) .AddPersistence(Configuration)
.AddInfrastructure(Configuration); .AddInfrastructureSevices(Configuration);
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<Folder Include="FinancialSpends\ValueObjects\" /> <Folder Include="FinancialSpends\ValueObjects\" />
<Folder Include="Identity\ValueObjects\" /> <Folder Include="Identity\ValueObjects\" />
<Folder Include="ProjectsTypes\ValueObjects\" /> <Folder Include="ProjectsTypes\ValueObjects\" />
<Folder Include="Steps\DomainEvents\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -26,14 +26,14 @@ namespace PSManagement.Infrastructure.DI ...@@ -26,14 +26,14 @@ namespace PSManagement.Infrastructure.DI
{ {
public static class DependencyInjection public static class DependencyInjection
{ {
public static IServiceCollection AddInfrastructure(this IServiceCollection services,IConfiguration configuration) public static IServiceCollection AddInfrastructureSevices(this IServiceCollection services,IConfiguration configuration)
{ {
services services
.AddAuthentication(configuration) .AddAuthentication(configuration)
.AddAuthorization() .AddAuthorization()
.AddServices(configuration) .AddServices(configuration)
.AddBackgroundServices(configuration); .AddBackgroundServices(configuration)
.AddCronJobs();
return services; return services;
} }
...@@ -95,5 +95,13 @@ namespace PSManagement.Infrastructure.DI ...@@ -95,5 +95,13 @@ namespace PSManagement.Infrastructure.DI
return services; return services;
} }
#endregion Authentication #endregion Authentication
#region Cron Jobs
private static IServiceCollection AddCronJobs(this IServiceCollection services) {
return services;
}
#endregion
} }
} }
namespace PSManagement.SharedKernel.CQRS.Query
{
public interface ILoggableQuery<out TResponse> : IQuery<TResponse>
{
}
}
...@@ -5,4 +5,5 @@ namespace PSManagement.SharedKernel.CQRS.Query ...@@ -5,4 +5,5 @@ namespace PSManagement.SharedKernel.CQRS.Query
public interface IQuery<out TResponse> : IRequest<TResponse> public interface IQuery<out TResponse> : IRequest<TResponse>
{ {
} }
} }
...@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.34601.136 ...@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.34601.136
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source Code", "Source Code", "{016CB7CA-D962-4D88-BA4F-FE5A94F35C90}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source Code", "Source Code", "{016CB7CA-D962-4D88-BA4F-FE5A94F35C90}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0FDF8D98-F5E9-4BEB-B801-36ED8F9E6763}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{A5B5B6F2-1390-4F70-8379-4FA9252043A3}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{A5B5B6F2-1390-4F70-8379-4FA9252043A3}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSManagement.Api", "PSManagement.Api\PSManagement.Api.csproj", "{CC2050CF-C358-4E97-8889-644924CFFFF6}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSManagement.Api", "PSManagement.Api\PSManagement.Api.csproj", "{CC2050CF-C358-4E97-8889-644924CFFFF6}"
...@@ -29,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{F823B4 ...@@ -29,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{F823B4
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedKernel", "SharedKernel", "{9C4A8DA5-024F-48AD-BD57-37FC8AEBAFA2}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SharedKernel", "SharedKernel", "{9C4A8DA5-024F-48AD-BD57-37FC8AEBAFA2}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{84B78C28-82FF-4D1D-88C0-A8E627582714}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSManagement.Presentation", "PSManagement.Presentation\PSManagement.Presentation.csproj", "{78B92586-BECB-456B-A06C-F251BD593025}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PSManagement.Presentation", "PSManagement.Presentation\PSManagement.Presentation.csproj", "{78B92586-BECB-456B-A06C-F251BD593025}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presentation", "Presentation", "{5E63B74D-16D2-4A0D-AB2C-9A74D9E80884}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presentation", "Presentation", "{5E63B74D-16D2-4A0D-AB2C-9A74D9E80884}"
...@@ -97,7 +93,6 @@ Global ...@@ -97,7 +93,6 @@ Global
{A8A58969-B142-4968-982B-16F771A7C805} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90} {A8A58969-B142-4968-982B-16F771A7C805} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{F823B488-2A6B-40C0-B332-65C861DA40E3} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90} {F823B488-2A6B-40C0-B332-65C861DA40E3} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{9C4A8DA5-024F-48AD-BD57-37FC8AEBAFA2} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90} {9C4A8DA5-024F-48AD-BD57-37FC8AEBAFA2} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{84B78C28-82FF-4D1D-88C0-A8E627582714} = {0FDF8D98-F5E9-4BEB-B801-36ED8F9E6763}
{78B92586-BECB-456B-A06C-F251BD593025} = {5E63B74D-16D2-4A0D-AB2C-9A74D9E80884} {78B92586-BECB-456B-A06C-F251BD593025} = {5E63B74D-16D2-4A0D-AB2C-9A74D9E80884}
{5E63B74D-16D2-4A0D-AB2C-9A74D9E80884} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90} {5E63B74D-16D2-4A0D-AB2C-9A74D9E80884} = {016CB7CA-D962-4D88-BA4F-FE5A94F35C90}
{122442B5-0221-43A7-80A3-555E91699951} = {8EEECA2A-3857-4081-A67C-49B9610FE5AE} {122442B5-0221-43A7-80A3-555E91699951} = {8EEECA2A-3857-4081-A67C-49B9610FE5AE}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment