SES-130 Create Armor Controller and Endpoint to return all armor
This commit is contained in:
parent
136a68bda4
commit
0c29cb0554
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// Metoda zwraca wszystkie dostępne pancerze
|
||||
/// </summary>
|
||||
/// <returns>Lista wszystkich pancerzy w bazie danych</returns>
|
||||
[HttpGet("getAllArmor")]
|
||||
public async Task<List<ArmorViewModel>> GetArmors()
|
||||
{
|
||||
return _service.Get().ToList();
|
||||
}
|
||||
}
|
||||
}
|
@ -36,10 +36,6 @@
|
||||
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SessionCompanion.Database\SessionCompanion.Database.csproj" />
|
||||
<ProjectReference Include="..\SessionCompanion.Extensions\SessionCompanion.Extensions.csproj" />
|
||||
|
@ -4,6 +4,12 @@
|
||||
<name>SessionCompanion</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:SessionCompanion.Controllers.ArmorController.GetArmors">
|
||||
<summary>
|
||||
Metoda zwraca wszystkie dostępne pancerze
|
||||
</summary>
|
||||
<returns>Lista wszystkich pancerzy w bazie danych</returns>
|
||||
</member>
|
||||
<member name="M:SessionCompanion.Controllers.CharacterController.Get(System.Int32)">
|
||||
<summary>
|
||||
Metoda zwraca postać ze wskazanym identyfikatorem
|
||||
|
Loading…
Reference in New Issue
Block a user