SES-118 Added Controller

This commit is contained in:
Karol Górzyński 2021-01-04 00:58:46 +01:00
parent 6ca10bd803
commit ca0bbe22a4
2 changed files with 17 additions and 2 deletions

View File

@ -8,6 +8,7 @@ using SessionCompanion.ViewModels.CharacterViewModels;
namespace SessionCompanion.Controllers namespace SessionCompanion.Controllers
{ {
using SessionCompanion.Hubs; using SessionCompanion.Hubs;
using SessionCompanion.ViewModels.UniversalModels;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
@ -78,13 +79,20 @@ namespace SessionCompanion.Controllers
} }
/// <summary> /// <summary>
/// Metoda zwraca wszystkie statystyki dla danej postaci /// Metoda zwraca wszystkie statystyki dla danej postaci
/// Zwracane statystyki dla:
/// Charisma
/// Constitution
/// Dexterity
/// Intelligence
/// Strength
/// Wisdom
/// </summary> /// </summary>
/// <param name="characterId"></param> /// <param name="characterId"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet("characterStats")] [HttpGet("characterStats")]
public async Task<Either<CharacterEveryStatViewModel, ErrorResponse>> GetCharacterEveryStat(int characterId) public async Task<Either<List<UniversalStatisticViewModel>, ErrorResponse>> GetCharacterEveryStat([Required] int characterId)
{ {
var statistics = await _service.GetCharacterEveryStat(characterId); var statistics = await _service.GetCharacterStatistics(characterId);
return statistics; return statistics;
} }
} }

View File

@ -27,6 +27,13 @@
<member name="M:SessionCompanion.Controllers.CharacterController.GetCharacterEveryStat(System.Int32)"> <member name="M:SessionCompanion.Controllers.CharacterController.GetCharacterEveryStat(System.Int32)">
<summary> <summary>
Metoda zwraca wszystkie statystyki dla danej postaci Metoda zwraca wszystkie statystyki dla danej postaci
Zwracane statystyki dla:
Charisma
Constitution
Dexterity
Intelligence
Strength
Wisdom
</summary> </summary>
<param name="characterId"></param> <param name="characterId"></param>
<returns></returns> <returns></returns>