Browse Source

refactoring

master
2 9 months ago
parent
commit
8339e4d51e
  1. 8
      ConsoleApp/ConsoleApp1/ConsoleApp1.csproj
  2. 12
      ConsoleApp/ConsoleApp1/Program.cs
  3. 0
      WebApi/Controllers/FieldController.cs
  4. 0
      WebApi/Controllers/WeatherForecastController.cs
  5. 0
      WebApi/Model/Field.cs
  6. 0
      WebApi/Model/FieldManager.cs
  7. 0
      WebApi/Model/Figure.cs
  8. 0
      WebApi/Model/FigureMover.cs
  9. 0
      WebApi/Model/IFieldManager.cs
  10. 0
      WebApi/Model/RandomField.cs
  11. 0
      WebApi/Program.cs
  12. 0
      WebApi/Properties/launchSettings.json
  13. 2
      WebApi/Startup.cs
  14. 0
      WebApi/TextFile.md
  15. 0
      WebApi/WeatherForecast.cs
  16. 0
      WebApi/WebApplication1.csproj
  17. 0
      WebApi/WebApplication1.csproj.user
  18. 31
      WebApi/WebApplication1.sln
  19. 0
      WebApi/appsettings.Development.json
  20. 0
      WebApi/appsettings.json
  21. 20
      WebApplication1.sln
  22. 222
      swagger.json

8
ConsoleApp/ConsoleApp1/ConsoleApp1.csproj

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>

12
ConsoleApp/ConsoleApp1/Program.cs

@ -0,0 +1,12 @@
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

0
Controllers/FieldController.cs → WebApi/Controllers/FieldController.cs

0
Controllers/WeatherForecastController.cs → WebApi/Controllers/WeatherForecastController.cs

0
Model/Field.cs → WebApi/Model/Field.cs

0
Model/FieldManager.cs → WebApi/Model/FieldManager.cs

0
Model/Figure.cs → WebApi/Model/Figure.cs

0
Model/FigureMover.cs → WebApi/Model/FigureMover.cs

0
Model/IFieldManager.cs → WebApi/Model/IFieldManager.cs

0
Model/RandomField.cs → WebApi/Model/RandomField.cs

0
Program.cs → WebApi/Program.cs

0
Properties/launchSettings.json → WebApi/Properties/launchSettings.json

2
Startup.cs → WebApi/Startup.cs

@ -29,7 +29,7 @@ namespace WebApplication1
services.AddControllers();
services.AddSingleton<IFieldManager>(new FieldManager());
services.AddSingleton<IFieldManager, FieldManager>();
services.AddSwaggerGen(c =>
{

0
TextFile.md → WebApi/TextFile.md

0
WeatherForecast.cs → WebApi/WeatherForecast.cs

0
WebApplication1.csproj → WebApi/WebApplication1.csproj

0
WebApplication1.csproj.user → WebApi/WebApplication1.csproj.user

31
WebApi/WebApplication1.sln

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30709.132
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1.csproj", "{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "..\ConsoleApp2\ConsoleApp2.csproj", "{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Release|Any CPU.Build.0 = Release|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F485B05F-F662-4D8B-8E28-EB57AA152B44}
EndGlobalSection
EndGlobal

0
appsettings.Development.json → WebApi/appsettings.Development.json

0
appsettings.json → WebApi/appsettings.json

20
WebApplication1.sln

@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30709.132
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1.csproj", "{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp\ConsoleApp1\ConsoleApp1.csproj", "{1135BD61-853A-47CB-BBC0-F6A3418FE133}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "..\ConsoleApp2\ConsoleApp2.csproj", "{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApplication1", "WebApi\WebApplication1.csproj", "{C01D1569-5E0A-415B-838B-5E528DFF37AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -13,14 +13,14 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E41DB1E-938D-4030-B8C7-B90C64A7B6CC}.Release|Any CPU.Build.0 = Release|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95D5C921-BDC7-4A88-AAAD-EF09B81221EF}.Release|Any CPU.Build.0 = Release|Any CPU
{1135BD61-853A-47CB-BBC0-F6A3418FE133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1135BD61-853A-47CB-BBC0-F6A3418FE133}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1135BD61-853A-47CB-BBC0-F6A3418FE133}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1135BD61-853A-47CB-BBC0-F6A3418FE133}.Release|Any CPU.Build.0 = Release|Any CPU
{C01D1569-5E0A-415B-838B-5E528DFF37AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C01D1569-5E0A-415B-838B-5E528DFF37AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C01D1569-5E0A-415B-838B-5E528DFF37AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C01D1569-5E0A-415B-838B-5E528DFF37AC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

222
swagger.json

@ -0,0 +1,222 @@
{
"openapi": "3.0.1",
"info": {
"title": "WebApplication1",
"version": "v1"
},
"paths": {
"/api/v1/Field/new": {
"post": {
"tags": [
"Field"
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
}
}
}
}
}
},
"/api/v1/Field/move": {
"post": {
"tags": [
"Field"
],
"parameters": [
{
"name": "identifier",
"in": "query",
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
}
}
}
}
}
},
"/api/v1/Field/list": {
"get": {
"tags": [
"Field"
],
"parameters": [
{
"name": "identifier",
"in": "query",
"schema": {
"type": "string",
"nullable": true
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Field"
}
}
}
}
}
}
},
"/WeatherForecast": {
"get": {
"tags": [
"WeatherForecast"
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WeatherForecast"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WeatherForecast"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/WeatherForecast"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Figure": {
"type": "object",
"properties": {
"figureColor": {
"type": "integer",
"format": "int32"
},
"figureType": {
"type": "integer",
"format": "int32"
},
"posX": {
"type": "integer",
"format": "int32"
},
"posY": {
"type": "integer",
"format": "int32"
}
},
"additionalProperties": false
},
"Field": {
"type": "object",
"properties": {
"identifier": {
"type": "string",
"nullable": true,
"readOnly": true
},
"figures": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Figure"
},
"nullable": true,
"readOnly": true
}
},
"additionalProperties": false
},
"WeatherForecast": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date-time"
},
"temperatureC": {
"type": "integer",
"format": "int32"
},
"temperatureF": {
"type": "integer",
"format": "int32",
"readOnly": true
},
"summaryWeather": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
}
}
}
}
Loading…
Cancel
Save