From d26d9278a31383017b9c527467bb8318bcd19f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20G=C3=B3rzy=C5=84ski?= Date: Wed, 13 Jan 2021 21:50:21 +0100 Subject: [PATCH] SES-148 Implement feedback --- .../Services/CharacterArmorService.cs | 6 +++--- .../Services/CharacterWeaponService.cs | 1 - .../Controllers/EquipmentController.cs | 20 +++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs index 89744cc..9413e2f 100644 --- a/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterArmorService.cs @@ -41,7 +41,7 @@ namespace SessionCompanion.Services.Services } if (armorToUse is null) - return new ErrorResponse() { StatusCode = 204, Message = "No weapon to change to" }; + return new ErrorResponse() { StatusCode = 204, Message = "No armor to change to" }; if (armorInUse is null) { @@ -50,7 +50,7 @@ namespace SessionCompanion.Services.Services { await Repository.Update(armorToUse); await Repository.Save(); - return new SuccessResponse("Character weapon updated") { SuccessCode = 200 }; + return new SuccessResponse("Character armor updated") { SuccessCode = 200 }; } catch (Exception e) { @@ -65,7 +65,7 @@ namespace SessionCompanion.Services.Services await Repository.Update(armorInUse); await Repository.Update(armorToUse); await Repository.Save(); - return new SuccessResponse("Character weapon updated") { SuccessCode = 204 }; + return new SuccessResponse("Character armor updated") { SuccessCode = 204 }; } catch (Exception e) { diff --git a/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs index 01addda..e003791 100644 --- a/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs +++ b/SessionCompanion/SessionCompanion.Services/Services/CharacterWeaponService.cs @@ -37,7 +37,6 @@ namespace SessionCompanion.Services.Services { // Dodaj optional rozbro postac var allWeapons = await Repository.Get(c => c.CharacterId.Equals(model.CharacterId)).AsNoTracking().ToListAsync(); - //var weaponsInUse = await Repository.Get(c => c.CharacterId.Equals(model.CharacterId)).Where(w => w.InUse.Equals(true)).ToListAsync(); var weaponsInUse = allWeapons.Where(w => w.InUse.Equals(true)).ToList(); var weapon = Mapper.Map(model); diff --git a/SessionCompanion/SessionCompanion/Controllers/EquipmentController.cs b/SessionCompanion/SessionCompanion/Controllers/EquipmentController.cs index ac6fee8..1331603 100644 --- a/SessionCompanion/SessionCompanion/Controllers/EquipmentController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/EquipmentController.cs @@ -66,11 +66,11 @@ namespace SessionCompanion.Controllers } /// - /// Metoda zmienia uzywany armor danej postaci + /// Metoda zmienia uzywaną zbroję danej postaci na taki jaki jest wybrany /// - /// - /// - /// + /// Id postaci + /// Id nowej zbroi + /// SuccessResponse/ErrorResponse [HttpPut("changeArmor")] public async Task> ChangeCharacterArmor(int characterId, int newArmorId) { @@ -79,10 +79,10 @@ namespace SessionCompanion.Controllers } /// - /// Metoda dodaje Armor do danej postaci + /// Metoda dodaje nową zbroje do danej postaci /// - /// - /// + /// View model z odpowiednimi parameterami + /// SuccessResponse/ErrorResponse [HttpPut("addArmor")] public async Task> AddCharacterArmor(CharacterArmorViewModel characterArmorViewModel) { @@ -101,10 +101,10 @@ namespace SessionCompanion.Controllers } /// - /// Metoda dodaje Weapon do danej postaci + /// Metoda dodaje broń do danej postaci /// - /// - /// + /// View model z odpowiednimi parameterami + /// SuccessResponse/ErrorResponse [HttpPut("addWeapon")] public async Task> AddCharacterWeapon(CharacterWeaponViewModel characterWeaponViewModel) {