SES-131 Endpoint OtherEquipment #55
@ -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;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Metoda zwraca wszystkie dostępne inne przedmioty
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Lista wszystkich innych przedmiotów w bazie danych</returns>
|
||||||
s426135 marked this conversation as resolved
|
|||||||
|
[HttpGet("getAllOtherEquipment")]
|
||||||
|
public async Task<Either<List<OtherEquipmentViewModel>, ErrorResponse>> GetOtherEquipment()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var otherEq = _service.Get().ToList();
|
||||||
|
return otherEq;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return new ErrorResponse()
|
||||||
|
{
|
||||||
|
StatusCode = 204,
|
||||||
|
Message = e.Message
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -36,10 +36,6 @@
|
|||||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Controllers\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\SessionCompanion.Database\SessionCompanion.Database.csproj" />
|
<ProjectReference Include="..\SessionCompanion.Database\SessionCompanion.Database.csproj" />
|
||||||
<ProjectReference Include="..\SessionCompanion.Extensions\SessionCompanion.Extensions.csproj" />
|
<ProjectReference Include="..\SessionCompanion.Extensions\SessionCompanion.Extensions.csproj" />
|
||||||
|
@ -31,6 +31,12 @@
|
|||||||
<param name="characterId"> Id postaci </param>
|
<param name="characterId"> Id postaci </param>
|
||||||
<returns> Listę wszystkich statystyk </returns>
|
<returns> Listę wszystkich statystyk </returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:SessionCompanion.Controllers.OtherEquipmentController.GetOtherEquipment">
|
||||||
|
<summary>
|
||||||
|
Metoda zwraca wszystkie dostępne inne przedmioty
|
||||||
|
</summary>
|
||||||
|
<returns>Lista wszystkich innych przedmiotów w bazie danych</returns>
|
||||||
|
</member>
|
||||||
<member name="M:SessionCompanion.Controllers.CharacterController.GetCharacterBasicInfo(System.Int32)">
|
<member name="M:SessionCompanion.Controllers.CharacterController.GetCharacterBasicInfo(System.Int32)">
|
||||||
<summary>
|
<summary>
|
||||||
Metoda zwraca podstawowe informacje dla danej postaci
|
Metoda zwraca podstawowe informacje dla danej postaci
|
||||||
|
Loading…
Reference in New Issue
Block a user
Brak Error Response