diff --git a/SessionCompanion/SessionCompanion/Controllers/OtherEquipmentController.cs b/SessionCompanion/SessionCompanion/Controllers/OtherEquipmentController.cs new file mode 100644 index 0000000..d21d202 --- /dev/null +++ b/SessionCompanion/SessionCompanion/Controllers/OtherEquipmentController.cs @@ -0,0 +1,42 @@ +using Microsoft.AspNetCore.Mvc; +using SessionCompanion.Extensions.EitherType; +using SessionCompanion.Services.Interfaces; +using SessionCompanion.ViewModels.ApiResponses; +using SessionCompanion.ViewModels.OtherEquipmentViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace SessionCompanion.Controllers +{ + [Route("api/otherEquipment")] + [ApiController] + public class OtherEquipmentController : Controller + { + private readonly IOtherEquipmentService _service; + public OtherEquipmentController(IOtherEquipmentService service) => _service = service; + + /// + /// Metoda zwraca wszystkie dostępne inne przedmioty + /// + /// Lista wszystkich innych przedmiotów w bazie danych + [HttpGet("getAllOtherEquipment")] + public async Task, ErrorResponse>> GetOtherEquipment() + { + try + { + var otherEq = _service.Get().ToList(); + return otherEq; + } + catch (Exception e) + { + return new ErrorResponse() + { + StatusCode = 204, + Message = e.Message + }; + } + } + } +} 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 e5e3d35..40a51a1 100644 --- a/SessionCompanion/SessionCompanion/SessionCompanion.xml +++ b/SessionCompanion/SessionCompanion/SessionCompanion.xml @@ -31,6 +31,12 @@ Id postaci Listę wszystkich statystyk + + + Metoda zwraca wszystkie dostępne inne przedmioty + + Lista wszystkich innych przedmiotów w bazie danych + Metoda zwraca podstawowe informacje dla danej postaci