SES-129 Add endpoint for all Spells
This commit is contained in:
parent
136a68bda4
commit
12a30784e1
@ -0,0 +1,28 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SessionCompanion.Services.Interfaces;
|
||||
using SessionCompanion.ViewModels.SpellViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SessionCompanion.Controllers
|
||||
{
|
||||
[Route("api/spell")]
|
||||
[ApiController]
|
||||
public class SpellController : Controller
|
||||
{
|
||||
private readonly ISpellService _service;
|
||||
public SpellController(ISpellService service) => _service = service;
|
||||
|
||||
/// <summary>
|
||||
/// Metoda zwraca wszystkie dostępne zaklecia
|
||||
/// </summary>
|
||||
/// <returns>Lista wszystkich zaklęć w bazie danych</returns>
|
||||
[HttpGet("getAllSpells")]
|
||||
public async Task<List<SpellViewModel>> GetSpells()
|
||||
{
|
||||
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" />
|
||||
|
@ -31,6 +31,12 @@
|
||||
<param name="characterId"> Id postaci </param>
|
||||
<returns> Listę wszystkich statystyk </returns>
|
||||
</member>
|
||||
<member name="M:SessionCompanion.Controllers.SpellController.GetSpells">
|
||||
<summary>
|
||||
Metoda zwraca wszystkie dostępne zaklecia
|
||||
</summary>
|
||||
<returns>Lista wszystkich zaklęć w bazie danych</returns>
|
||||
</member>
|
||||
<member name="M:SessionCompanion.Controllers.UserController.Login(System.String,System.String)">
|
||||
<summary>
|
||||
Metoda przyjmuje login oraz hasło i sprawdza czy istnieje użytkownik o podanych parametrach
|
||||
|
Loading…
Reference in New Issue
Block a user