Merge branch 'feature/kitchen-ops-bff-boundary' into development
This commit is contained in:
commit
b0c300fa47
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
.tasks/
|
||||
.agile/
|
||||
**/bin/
|
||||
**/obj/
|
||||
|
||||
10
Directory.Build.props
Normal file
10
Directory.Build.props
Normal file
@ -0,0 +1,10 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Authors>AgileWebs</Authors>
|
||||
<Company>AgileWebs</Company>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<RepositoryUrl>http://192.168.68.156:3000/AgileWebs/kitchen-ops-bff</RepositoryUrl>
|
||||
<PackageProjectUrl>http://192.168.68.156:3000/AgileWebs/kitchen-ops-bff</PackageProjectUrl>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
7
Kitchen.Ops.Bff.slnx
Normal file
7
Kitchen.Ops.Bff.slnx
Normal file
@ -0,0 +1,7 @@
|
||||
<Solution>
|
||||
<Folder Name="/src/">
|
||||
<Project Path="src/Kitchen.Ops.Bff.Application/Kitchen.Ops.Bff.Application.csproj" />
|
||||
<Project Path="src/Kitchen.Ops.Bff.Contracts/Kitchen.Ops.Bff.Contracts.csproj" />
|
||||
<Project Path="src/Kitchen.Ops.Bff.Rest/Kitchen.Ops.Bff.Rest.csproj" />
|
||||
</Folder>
|
||||
</Solution>
|
||||
@ -0,0 +1,12 @@
|
||||
using Kitchen.Ops.Bff.Contracts.Requests;
|
||||
using Kitchen.Ops.Bff.Contracts.Responses;
|
||||
|
||||
namespace Kitchen.Ops.Bff.Application.Adapters;
|
||||
|
||||
public sealed class DefaultKitchenServiceClient : IKitchenServiceClient
|
||||
{
|
||||
public Task<GetKitchenOpsBoardResponse> FetchAsync(GetKitchenOpsBoardRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(new GetKitchenOpsBoardResponse(request.ContextId, "Default service-backed response."));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
using Kitchen.Ops.Bff.Contracts.Requests;
|
||||
using Kitchen.Ops.Bff.Contracts.Responses;
|
||||
|
||||
namespace Kitchen.Ops.Bff.Application.Adapters;
|
||||
|
||||
public interface IKitchenServiceClient
|
||||
{
|
||||
Task<GetKitchenOpsBoardResponse> FetchAsync(GetKitchenOpsBoardRequest request, CancellationToken cancellationToken);
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
using Kitchen.Ops.Bff.Application.Adapters;
|
||||
using Kitchen.Ops.Bff.Contracts.Requests;
|
||||
using Kitchen.Ops.Bff.Contracts.Responses;
|
||||
|
||||
namespace Kitchen.Ops.Bff.Application.Handlers;
|
||||
|
||||
public sealed class GetKitchenOpsBoardHandler(IKitchenServiceClient serviceClient) : IGetKitchenOpsBoardHandler
|
||||
{
|
||||
public Task<GetKitchenOpsBoardResponse> HandleAsync(GetKitchenOpsBoardRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
return serviceClient.FetchAsync(request, cancellationToken);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
using Kitchen.Ops.Bff.Contracts.Requests;
|
||||
using Kitchen.Ops.Bff.Contracts.Responses;
|
||||
|
||||
namespace Kitchen.Ops.Bff.Application.Handlers;
|
||||
|
||||
public interface IGetKitchenOpsBoardHandler
|
||||
{
|
||||
Task<GetKitchenOpsBoardResponse> HandleAsync(GetKitchenOpsBoardRequest request, CancellationToken cancellationToken);
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Kitchen.Ops.Bff.Contracts\Kitchen.Ops.Bff.Contracts.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@ -0,0 +1,3 @@
|
||||
namespace Kitchen.Ops.Bff.Contracts.Requests;
|
||||
|
||||
public sealed record GetKitchenOpsBoardRequest(string ContextId);
|
||||
@ -0,0 +1,3 @@
|
||||
namespace Kitchen.Ops.Bff.Contracts.Responses;
|
||||
|
||||
public sealed record GetKitchenOpsBoardResponse(string ContextId, string Summary);
|
||||
13
src/Kitchen.Ops.Bff.Rest/Kitchen.Ops.Bff.Rest.csproj
Normal file
13
src/Kitchen.Ops.Bff.Rest/Kitchen.Ops.Bff.Rest.csproj
Normal file
@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Kitchen.Ops.Bff.Application\Kitchen.Ops.Bff.Application.csproj" />
|
||||
<ProjectReference Include="..\Kitchen.Ops.Bff.Contracts\Kitchen.Ops.Bff.Contracts.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
17
src/Kitchen.Ops.Bff.Rest/Program.cs
Normal file
17
src/Kitchen.Ops.Bff.Rest/Program.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Kitchen.Ops.Bff.Application.Adapters;
|
||||
using Kitchen.Ops.Bff.Application.Handlers;
|
||||
using Kitchen.Ops.Bff.Contracts.Requests;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Services.AddSingleton<IKitchenServiceClient, DefaultKitchenServiceClient>();
|
||||
builder.Services.AddSingleton<IGetKitchenOpsBoardHandler, GetKitchenOpsBoardHandler>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapGet("/api/kitchen/ops/board", async (string contextId, IGetKitchenOpsBoardHandler handler, CancellationToken ct) =>
|
||||
{
|
||||
var request = new GetKitchenOpsBoardRequest(contextId);
|
||||
return Results.Ok(await handler.HandleAsync(request, ct));
|
||||
});
|
||||
|
||||
app.Run();
|
||||
23
src/Kitchen.Ops.Bff.Rest/Properties/launchSettings.json
Normal file
23
src/Kitchen.Ops.Bff.Rest/Properties/launchSettings.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"http": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "http://localhost:0",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"https": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:0;http://localhost:0",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8
src/Kitchen.Ops.Bff.Rest/appsettings.Development.json
Normal file
8
src/Kitchen.Ops.Bff.Rest/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
9
src/Kitchen.Ops.Bff.Rest/appsettings.json
Normal file
9
src/Kitchen.Ops.Bff.Rest/appsettings.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user