-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the customisation of API URIs per domain and subdomain
- Loading branch information
Showing
15 changed files
with
112 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Aviant.Core.DDD.Domain; | ||
|
||
namespace CleanDDDArchitecture.Domains.Todo.Core; | ||
|
||
public interface ITodoDomainConfiguration : IDomainConfigurationContainer | ||
{ | ||
const string RouteSegment = "todo"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Aviant.Application.Persistence.Orchestration; | ||
using Aviant.Application.UseCases; | ||
using CleanDDDArchitecture.Domains.Todo.Application.Persistence; | ||
using CleanDDDArchitecture.Domains.Todo.Core; | ||
using CleanDDDArchitecture.Hosts.RestApi.Core.Routing; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace CleanDDDArchitecture.Domains.Todo.Hosts.RestApi.Core; | ||
|
||
/// <inheritdoc /> | ||
/// <summary> | ||
/// Todo endpoints | ||
/// </summary> | ||
[RouteSegment(ITodoDomainConfiguration.RouteSegment)] | ||
public abstract class ApiController : CleanDDDArchitecture.Hosts.RestApi.Core.Controllers.ApiController | ||
{ | ||
/// <summary> | ||
/// </summary> | ||
protected new IOrchestrator<ITodoDbContextWrite> Orchestrator => | ||
HttpContext.RequestServices.GetRequiredService<IOrchestrator<ITodoDbContextWrite>>(); | ||
} | ||
|
||
/// <inheritdoc /> | ||
/// <summary> | ||
/// Todo endpoint | ||
/// </summary> | ||
/// <typeparam name="TUseCase"></typeparam> | ||
/// <typeparam name="TUseCaseOutput"></typeparam> | ||
[RouteSegment(ITodoDomainConfiguration.RouteSegment)] | ||
public abstract class ApiController<TUseCase, TUseCaseOutput> | ||
: CleanDDDArchitecture.Hosts.RestApi.Core.Controllers.ApiController<TUseCase, TUseCaseOutput> | ||
where TUseCase : class, IUseCase<TUseCaseOutput> | ||
where TUseCaseOutput : class, IUseCaseOutput | ||
{ | ||
/// <inheritdoc /> | ||
protected ApiController(TUseCase useCase) | ||
: base(useCase) | ||
{ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<RootNamespace>CleanDDDArchitecture.Domains.Todo.Hosts.RestApi.Core</RootNamespace> | ||
<AssemblyName>CleanDDDArchitecture.Domains.Todo.Hosts.RestApi.Core</AssemblyName> | ||
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\..\..\Hosts\RestApi\Core\Core.csproj" /> | ||
<ProjectReference Include="..\..\..\CrossCutting\CrossCutting.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Domains/Todo/SubDomains/TodoItem/Core/ITodoItemDomainConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Aviant.Core.DDD.Domain; | ||
|
||
namespace CleanDDDArchitecture.Domains.Todo.SubDomains.TodoItem.Core; | ||
|
||
public interface ITodoItemDomainConfiguration : IDomainConfigurationContainer | ||
{ | ||
const string RouteSegment = "item"; | ||
} |
17 changes: 6 additions & 11 deletions
17
Domains/Todo/SubDomains/TodoItem/Hosts/RestApi/Presentation/ApiController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Domains/Todo/SubDomains/TodoItem/Infrastructure/TodoItemConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Domains/Todo/SubDomains/TodoList/Core/ITodoListDomainConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using Aviant.Core.DDD.Domain; | ||
|
||
namespace CleanDDDArchitecture.Domains.Todo.SubDomains.TodoList.Core; | ||
|
||
public interface ITodoListDomainConfiguration : IDomainConfigurationContainer | ||
{ | ||
const string RouteSegment = "list"; | ||
} |
17 changes: 6 additions & 11 deletions
17
Domains/Todo/SubDomains/TodoList/Hosts/RestApi/Presentation/ApiController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Domains/Todo/SubDomains/TodoList/Infrastructure/TodoListConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters