From 0c29cb0554793110c15f6d36ddc573eb71747327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Thu, 7 Jan 2021 16:45:54 +0100 Subject: [PATCH] SES-130 Create Armor Controller and Endpoint to return all armor --- .../Controllers/ArmorController.cs | 28 +++++++++++++++++++ .../SessionCompanion/SessionCompanion.csproj | 4 --- .../SessionCompanion/SessionCompanion.xml | 6 ++++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 SessionCompanion/SessionCompanion/Controllers/ArmorController.cs diff --git a/SessionCompanion/SessionCompanion/Controllers/ArmorController.cs b/SessionCompanion/SessionCompanion/Controllers/ArmorController.cs new file mode 100644 index 0000000..41c6048 --- /dev/null +++ b/SessionCompanion/SessionCompanion/Controllers/ArmorController.cs @@ -0,0 +1,28 @@ +using Microsoft.AspNetCore.Mvc; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.ArmorViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace SessionCompanion.Controllers +{ + [Route("api/armor")] + [ApiController] + public class ArmorController : Controller + { + private readonly IArmorService _service; + public ArmorController(IArmorService service) => _service = service; + + /// + /// Metoda zwraca wszystkie dostępne pancerze + /// + /// Lista wszystkich pancerzy w bazie danych + [HttpGet("getAllArmor")] + public async Task> GetArmors() + { + return _service.Get().ToList(); + } + } +} diff --git a/SessionCompanion/SessionCompanion/SessionCompanion.csproj b/SessionCompanion/SessionCompanion/SessionCompanion.csproj index c455a8f..f0f585f 100644 --- a/SessionCompanion/SessionCompanion/SessionCompanion.csproj +++ b/SessionCompanion/SessionCompanion/SessionCompanion.csproj @@ -36,10 +36,6 @@ - - - - diff --git a/SessionCompanion/SessionCompanion/SessionCompanion.xml b/SessionCompanion/SessionCompanion/SessionCompanion.xml index b96a03b..1c7e742 100644 --- a/SessionCompanion/SessionCompanion/SessionCompanion.xml +++ b/SessionCompanion/SessionCompanion/SessionCompanion.xml @@ -4,6 +4,12 @@ SessionCompanion + + + Metoda zwraca wszystkie dostępne pancerze + + Lista wszystkich pancerzy w bazie danych + Metoda zwraca postać ze wskazanym identyfikatorem