-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e524065
commit 04903e3
Showing
69 changed files
with
3,775 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
OwnProjects/43_API/BlazorApiClientApp/BlazoApiGenereatedClient/App.razor
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,12 @@ | ||
<Router AppAssembly="@typeof(App).Assembly"> | ||
<Found Context="routeData"> | ||
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> | ||
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> | ||
</Found> | ||
<NotFound> | ||
<PageTitle>Not found</PageTitle> | ||
<LayoutView Layout="@typeof(MainLayout)"> | ||
<p role="alert">Sorry, there's nothing at this address.</p> | ||
</LayoutView> | ||
</NotFound> | ||
</Router> |
35 changes: 35 additions & 0 deletions
35
...ojects/43_API/BlazorApiClientApp/BlazoApiGenereatedClient/BlazoApiGenereatedClient.csproj
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,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="OpenAPIs\swagger.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="OpenAPIs\swagger1.json" ClassName="TodoApi" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<OpenApiReference Include="OpenAPIs\swagger2.json" CodeGenerator="NSwagCSharp" Namespace="BlazoApiGenereatedClient.Services" ClassName="TodoApi"> | ||
<SourceUri>https://localhost:7000/swagger/v1/swagger.json</SourceUri> | ||
</OpenApiReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="7.0.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||
<PackageReference Include="NSwag.ApiDescription.Client" Version="13.18.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |
13 changes: 13 additions & 0 deletions
13
OwnProjects/43_API/BlazorApiClientApp/BlazoApiGenereatedClient/Data/WeatherForecast.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,13 @@ | ||
namespace BlazoApiGenereatedClient.Data | ||
{ | ||
public class WeatherForecast | ||
{ | ||
public DateOnly Date { get; set; } | ||
|
||
public int TemperatureC { get; set; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
|
||
public string? Summary { get; set; } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...rojects/43_API/BlazorApiClientApp/BlazoApiGenereatedClient/Data/WeatherForecastService.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,20 @@ | ||
namespace BlazoApiGenereatedClient.Data | ||
{ | ||
public class WeatherForecastService | ||
{ | ||
private static readonly string[] Summaries = new[] | ||
{ | ||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
}; | ||
|
||
public Task<WeatherForecast[]> GetForecastAsync(DateOnly startDate) | ||
{ | ||
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] | ||
}).ToArray()); | ||
} | ||
} | ||
} |
310 changes: 310 additions & 0 deletions
310
OwnProjects/43_API/BlazorApiClientApp/BlazoApiGenereatedClient/OpenAPIs/swagger.json
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,310 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "TodoApi", | ||
"version": "1.0" | ||
}, | ||
"paths": { | ||
"/api/Authentication/token": { | ||
"post": { | ||
"tags": [ | ||
"Authentication" | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/AuthenticationData" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/AuthenticationData" | ||
} | ||
}, | ||
"application/*+json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/AuthenticationData" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"text/plain": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/api/Todos": { | ||
"get": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "GetAllTodos", | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"text/plain": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
} | ||
}, | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "CreateTodos", | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"application/*+json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"text/plain": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
}, | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/api/Todos/{todoId}": { | ||
"get": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "GetOneTodos", | ||
"parameters": [ | ||
{ | ||
"name": "todoId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"text/plain": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
}, | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/TodoModel" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"put": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "UpdateTodos", | ||
"parameters": [ | ||
{ | ||
"name": "todoId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"text/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
"application/*+json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "DeleteTodos", | ||
"parameters": [ | ||
{ | ||
"name": "todoId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
}, | ||
"/api/Todos/{todoId}/Complete": { | ||
"put": { | ||
"tags": [ | ||
"Todos" | ||
], | ||
"operationId": "CompleteTodos", | ||
"parameters": [ | ||
{ | ||
"name": "todoId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"AuthenticationData": { | ||
"type": "object", | ||
"properties": { | ||
"userName": { | ||
"type": "string", | ||
"nullable": true | ||
}, | ||
"password": { | ||
"type": "string", | ||
"nullable": true | ||
} | ||
}, | ||
"additionalProperties": false | ||
}, | ||
"TodoModel": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"task": { | ||
"type": "string", | ||
"nullable": true | ||
}, | ||
"assignedTo": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"isComplete": { | ||
"type": "boolean" | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.