SES-128 Endpoint Broni #52

Merged
s426134 merged 7 commits from SES-128 into dev 2021-01-09 14:07:07 +01:00
3 changed files with 37 additions and 4 deletions
Showing only changes of commit 99da683632 - Show all commits

View File

@ -0,0 +1,31 @@
using Microsoft.AspNetCore.Mvc;
using SessionCompanion.Extensions.EitherType;
using SessionCompanion.Services.Interfaces;
using System.Threading.Tasks;
using SessionCompanion.ViewModels.WeaponViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SessionCompanion.ViewModels.ApiResponses;
namespace SessionCompanion.Controllers
{
[Route("api/weapon")]
[ApiController]
public class WeaponController : Controller
{
private readonly IWeaponService _service;
public WeaponController(IWeaponService service) => _service = service;
/// <summary>
/// Metoda zwraca wszystkie dostępne bronie
/// </summary>
/// <returns>Lista wszystkich broni w bazie danych</returns>
[HttpGet("getAllWeapons")]
public async Task<List<WeaponViewModel>> GetWeapons()

Brak Error Response

Brak Error Response
{
return _service.Get().ToList();
}
}
}

View File

@ -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" />

View File

@ -52,6 +52,12 @@
</summary>
<returns>true jesli ktoś jest już zalogowany i false jeśli nie</returns>
</member>
<member name="M:SessionCompanion.Controllers.WeaponController.GetWeapons">
<summary>
Metoda zwraca wszystkie dostępne bronie
</summary>
<returns>Lista wszystkich broni w bazie danych</returns>
</member>
<member name="F:SessionCompanion.Hubs.SessionHub.sessionHubData">
<summary>
Klasa zawierająca wszystkie dane potrzebne w SignalR odnośnie aktualnej sesji