diff --git a/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs b/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs index a7028c7..a6e1006 100644 --- a/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs +++ b/SessionCompanion/SessionCompanion.Services/Intefraces/IUserService.cs @@ -10,5 +10,6 @@ namespace SessionCompanion.Services.Interfaces { public interface IUserService : IServiceBase { + Task SearchUserByNickname(string userName); } } diff --git a/SessionCompanion/SessionCompanion.Services/Services/UserService.cs b/SessionCompanion/SessionCompanion.Services/Services/UserService.cs index f0c8a68..d60b7e1 100644 --- a/SessionCompanion/SessionCompanion.Services/Services/UserService.cs +++ b/SessionCompanion/SessionCompanion.Services/Services/UserService.cs @@ -17,5 +17,11 @@ namespace SessionCompanion.Services.Services { public UserService(IMapper mapper, IRepository repository) : base(mapper, repository) { } + + public async Task SearchUserByNickname(string userName) + { + var User = await Repository.Get(u => u.Nickname.Equals(userName)).FirstOrDefaultAsync(); + return Mapper.Map(User); + } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/AlignmentViewModels/AlignmentViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/AlignmentViewModels/AlignmentViewModel.cs index 34e71b6..235e797 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/AlignmentViewModels/AlignmentViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/AlignmentViewModels/AlignmentViewModel.cs @@ -1,12 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.AlignmentViewModels +namespace SessionCompanion.ViewModels.AlignmentViewModels { public class AlignmentViewModel { + /// + /// Identyfikator przynależności postaci + /// public int Id { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/BackgroundViewModels/BackgroundViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/BackgroundViewModels/BackgroundViewModel.cs index a82d167..58143e8 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/BackgroundViewModels/BackgroundViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/BackgroundViewModels/BackgroundViewModel.cs @@ -1,12 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.BackgroundViewModels +namespace SessionCompanion.ViewModels.BackgroundViewModels { public class BackgroundViewModel { + /// + /// Identyfikator przeszłości postaci + /// public int Id { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/BiographyViewModels/BiographyViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/BiographyViewModels/BiographyViewModel.cs index 88bd830..36554b0 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/BiographyViewModels/BiographyViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/BiographyViewModels/BiographyViewModel.cs @@ -1,18 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.BiographyViewModels +namespace SessionCompanion.ViewModels.BiographyViewModels { public class BiographyViewModel { + /// + /// Identyfikator biografii postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Nazwa postaci + /// public string Name { get; set; } + + /// + /// Identyfikator klasy postaci + /// public int ClassId { get; set; } + + /// + /// Identyfikator przynależności postaci + /// public int AlignmentId { get; set; } + + /// + /// Identyfikator przeszłości postaci + /// public int BackgroundId { get; set; } + + /// + /// Płeć postaci + /// public string Sex { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs index eafd6ae..525419f 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterBasicStatsViewModel.cs @@ -3,7 +3,7 @@ public class CharacterBasicStatsViewModel { /// - /// Identyfikator psotaci + /// Identyfikator postaci /// public int Id { get; set; } diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterForLoginViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterForLoginViewModel.cs index fecc287..64ce97c 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterForLoginViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterForLoginViewModel.cs @@ -3,7 +3,7 @@ public class CharacterForLoginViewModel { /// - /// Identyfikator psotaci + /// Identyfikator postaci /// public int Id { get; set; } diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterViewModel.cs index 6b82033..f227eeb 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharacterViewModels/CharacterViewModel.cs @@ -3,7 +3,7 @@ public class CharacterViewModel { /// - /// Identyfikator psotaci + /// Identyfikator postaci /// public int Id { get; set; } diff --git a/SessionCompanion/SessionCompanion.ViewModels/CharismaViewModels/CharismaViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/CharismaViewModels/CharismaViewModel.cs index 5ecce81..d71fb83 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/CharismaViewModels/CharismaViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/CharismaViewModels/CharismaViewModel.cs @@ -1,25 +1,75 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.CharismaViewModels +namespace SessionCompanion.ViewModels.CharismaViewModels { public class CharismaViewModel { + /// + /// Identyfikator charyzmy postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość charyzmy + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w charyźmie + /// public bool CanSaveThrows { get; set; } + + /// + /// Wartość umiejętności oszustwa + /// public int Deception { get; set; } + + /// + /// Czy postać posiada biegłość w oszustwie + /// public bool CanDeception { get; set; } + + /// + /// Wartość umiejętności zastraszania + /// public int Intimidation { get; set; } + + /// + /// Czy postać posiada biegłość w zastraszaniu + /// public bool CanIntimidation { get; set; } + + /// + /// Wartość umiejętności występowania + /// public int Performance { get; set; } + + /// + /// Czy postać posiada biegłość w występowaniu + /// public bool CanPerformance { get; set; } + + /// + /// Wartość umiejętności perswazji + /// public int Persuasion { get; set; } + + /// + /// Czy postać posiada biegłość w perswazji + /// public bool CanPersuasion { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion.ViewModels/ClassViewModels/ClassViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/ClassViewModels/ClassViewModel.cs index 0a36df8..50b2dc7 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/ClassViewModels/ClassViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/ClassViewModels/ClassViewModel.cs @@ -7,7 +7,14 @@ namespace SessionCompanion.ViewModels.ClassViewModels { public class ClassViewModel { + /// + /// Identyfikator klasy postaci + /// public int Id { get; set; } + + /// + /// Nazwa klasy + /// public string Name { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/ConstitutionViewModels/ConstitutionViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/ConstitutionViewModels/ConstitutionViewModel.cs index bd1318f..8e8bfe1 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/ConstitutionViewModels/ConstitutionViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/ConstitutionViewModels/ConstitutionViewModel.cs @@ -1,17 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.ConstitutionViewModels +namespace SessionCompanion.ViewModels.ConstitutionViewModels { public class ConstitutionViewModel { + /// + /// Identyfikator kondycji postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość kondycji + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w kondycji + /// public bool CanSaveThrows { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion.ViewModels/DexterityViewModels/DexterityViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/DexterityViewModels/DexterityViewModel.cs index de82574..c6a2a5c 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/DexterityViewModels/DexterityViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/DexterityViewModels/DexterityViewModel.cs @@ -1,23 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.DexterityViewModels +namespace SessionCompanion.ViewModels.DexterityViewModels { public class DexterityViewModel { + /// + /// Identyfikator zręczności postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość zręczności + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w zręczności + /// public bool CanSaveThrows { get; set; } + + /// + /// Wartość umiejętności akrobatyki + /// public int Acrobatics { get; set; } + + /// + /// Czy postać posiada biegłość w akrobatyce + /// public bool CanAcrobatics { get; set; } + + /// + /// Wartość umiejętności zwinnych dłoni + /// public int SleightOfHand { get; set; } + + /// + /// Czy postać posiada biegłość w zwinnych dłoniach + /// public bool CanSleightOfHand { get; set; } + + /// + /// Wartość umiejętności skradania się + /// public int Stealth { get; set; } + + /// + /// Czy postać posiada biegłość w skradaniu się + /// public bool CanStealth { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion.ViewModels/IntelligenceViewModels/IntelligenceViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/IntelligenceViewModels/IntelligenceViewModel.cs index f72bafa..921afee 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/IntelligenceViewModels/IntelligenceViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/IntelligenceViewModels/IntelligenceViewModel.cs @@ -1,27 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.IntelligenceViewModels +namespace SessionCompanion.ViewModels.IntelligenceViewModels { public class IntelligenceViewModel { + /// + /// Identyfikator inteligencji postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość inteligencji + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w inteligencji + /// public bool CanSaveThrows { get; set; } + + /// + /// Wartość umiejętności wiedzy tejemnej + /// public int Arcana { get; set; } + + /// + /// Czy postać posiada biegłość w wiedzy tejemnej + /// public bool CanArcana { get; set; } + + /// + /// Wartość umiejętności historii + /// public int History { get; set; } + + /// + /// Czy postać posiada biegłość w historii + /// public bool CanHistory { get; set; } + + /// + /// Wartość umiejętności śledztwa + /// public int Investigation { get; set; } + + /// + /// Czy postać posiada biegłość w śledztwie + /// public bool CanInvestigation { get; set; } + + /// + /// Wartość umiejętności przyrody + /// public int Nature { get; set; } + + /// + /// Czy postać posiada biegłość w przyrodzie + /// public bool CanNature { get; set; } + + /// + /// Wartość umiejętności religii + /// public int Religion { get; set; } + + /// + /// Czy postać posiada biegłość w religii + /// public bool CanReligion { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion.ViewModels/RaceViewModels/RaceViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/RaceViewModels/RaceViewModel.cs index da60376..65487b1 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/RaceViewModels/RaceViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/RaceViewModels/RaceViewModel.cs @@ -1,13 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.RaceViewModels +namespace SessionCompanion.ViewModels.RaceViewModels { public class RaceViewModel { + /// + /// Identyfikator rasy postaci + /// public int Id { get; set; } + + /// + /// Nazwa rasy + /// public string Name { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml index 9805829..88ffc4e 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml +++ b/SessionCompanion/SessionCompanion.ViewModels/SessionCompanion.ViewModels.xml @@ -4,9 +4,54 @@ SessionCompanion.ViewModels + + + Identyfikator przynależności postaci + + + + + Identyfikator przeszłości postaci + + + + + Identyfikator biografii postaci + + + + + Identyfikator postaci + + + + + Nazwa postaci + + + + + Identyfikator klasy postaci + + + + + Identyfikator przynależności postaci + + + + + Identyfikator przeszłości postaci + + + + + Płeć postaci + + - Identyfikator psotaci + Identyfikator postaci @@ -26,7 +71,7 @@ - Identyfikator psotaci + Identyfikator postaci @@ -51,7 +96,7 @@ - Identyfikator psotaci + Identyfikator postaci @@ -59,5 +104,450 @@ Id użytkownika do którego przypisana jest postać + + + Identyfikator charyzmy postaci + + + + + Identyfikator postaci + + + + + Wartość charyzmy + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w charyźmie + + + + + Wartość umiejętności oszustwa + + + + + Czy postać posiada biegłość w oszustwie + + + + + Wartość umiejętności zastraszania + + + + + Czy postać posiada biegłość w zastraszaniu + + + + + Wartość umiejętności występowania + + + + + Czy postać posiada biegłość w występowaniu + + + + + Wartość umiejętności perswazji + + + + + Czy postać posiada biegłość w perswazji + + + + + Identyfikator klasy postaci + + + + + Nazwa klasy + + + + + Identyfikator kondycji postaci + + + + + Identyfikator postaci + + + + + Wartość kondycji + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w kondycji + + + + + Identyfikator zręczności postaci + + + + + Identyfikator postaci + + + + + Wartość zręczności + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w zręczności + + + + + Wartość umiejętności akrobatyki + + + + + Czy postać posiada biegłość w akrobatyce + + + + + Wartość umiejętności zwinnych dłoni + + + + + Czy postać posiada biegłość w zwinnych dłoniach + + + + + Wartość umiejętności skradania się + + + + + Czy postać posiada biegłość w skradaniu się + + + + + Identyfikator inteligencji postaci + + + + + Identyfikator postaci + + + + + Wartość inteligencji + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w inteligencji + + + + + Wartość umiejętności wiedzy tejemnej + + + + + Czy postać posiada biegłość w wiedzy tejemnej + + + + + Wartość umiejętności historii + + + + + Czy postać posiada biegłość w historii + + + + + Wartość umiejętności śledztwa + + + + + Czy postać posiada biegłość w śledztwie + + + + + Wartość umiejętności przyrody + + + + + Czy postać posiada biegłość w przyrodzie + + + + + Wartość umiejętności religii + + + + + Czy postać posiada biegłość w religii + + + + + Identyfikator rasy postaci + + + + + Nazwa rasy + + + + + Identyfikator statystyk postaci + + + + + Identyfikator postaci + + + + + Ilość punktów doświadczenia + + + + + Poziom postaci + + + + + Szybkość postaci + + + + + Inicjatywa postaci + + + + + Maksymalna wartość punktów życia + + + + + Aktualna wartość punktów życia + + + + + Klasa pancerza + + + + + Premia z biegłości + + + + + Identyfikator siły postaci + + + + + Identyfikator postaci + + + + + Wartość siły + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w sile + + + + + Wartość umiejętności atletyki + + + + + Czy postać posiada biegłość w atletyce + + + + + Identyfikator użytkownika + + + + + Nazwa użytkowika + + + + + Hasło użytkownika + + + + + Identyfikator mądrości postaci + + + + + Identyfikator postaci + + + + + Wartość mądrości + + + + + Modyfikator rzutów + + + + + Modyfikator rzutów obronnych + + + + + Czy postać posiada biegłość w mądrości + + + + + Wartość umiejętności opieki nad zwierzętami + + + + + Czy postać posiada biegłość w opiece nad zwierzętami + + + + + Wartość umiejętności intuicji + + + + + Czy postać posiada biegłość w intuicji + + + + + Wartość umiejętności medycyny + + + + + Czy postać posiada biegłość w medycynie + + + + + Wartość umiejętności percepcji + + + + + Czy postać posiada biegłość w percepcji + + + + + Wartość umiejętności sztuki przetrwania + + + + + Czy postać posiada biegłość w sztuce przetrwania + + diff --git a/SessionCompanion/SessionCompanion.ViewModels/StatisticsViewModels/StatisticsViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/StatisticsViewModels/StatisticsViewModel.cs index c2445c6..500003e 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/StatisticsViewModels/StatisticsViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/StatisticsViewModels/StatisticsViewModel.cs @@ -1,28 +1,64 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; +using System.ComponentModel.DataAnnotations; namespace SessionCompanion.ViewModels.StatisticsViewModels { public class StatisticsViewModel { + + /// + /// Identyfikator statystyk postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } - [Range(0, int.MaxValue)] + + /// + /// Ilość punktów doświadczenia + /// public int ExperiencePoints { get; set; } + + /// + /// Poziom postaci + /// [Range(0, int.MaxValue)] public int Level { get; set; } + + /// + /// Szybkość postaci + /// [Range(0, int.MaxValue)] public int Speed { get; set; } + + /// + /// Inicjatywa postaci + /// [Range(0, int.MaxValue)] public int Initiative { get; set; } + + /// + /// Maksymalna wartość punktów życia + /// [Range(0, int.MaxValue)] public int HealthPoints { get; set; } + + /// + /// Aktualna wartość punktów życia + /// [Range(0, int.MaxValue)] public int CurrentHealthPoints { get; set; } + + /// + /// Klasa pancerza + /// [Range(0, int.MaxValue)] public int ArmorClass { get; set; } + + /// + /// Premia z biegłości + /// [Range(0, int.MaxValue)] public int Proficiency { get; set; } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/StrengthViewModels/StrengthViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/StrengthViewModels/StrengthViewModel.cs index 9be3c10..17b56db 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/StrengthViewModels/StrengthViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/StrengthViewModels/StrengthViewModel.cs @@ -1,19 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.StrengthViewModels +namespace SessionCompanion.ViewModels.StrengthViewModels { public class StrengthViewModel { + /// + /// Identyfikator siły postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość siły + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w sile + /// public bool CanSaveThrows { get; set; } + + /// + /// Wartość umiejętności atletyki + /// public int Athletics { get; set; } + + /// + /// Czy postać posiada biegłość w atletyce + /// public bool CanAthletics { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion.ViewModels/UserViewModels/UserViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/UserViewModels/UserViewModel.cs index 66e3dcd..65a3087 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/UserViewModels/UserViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/UserViewModels/UserViewModel.cs @@ -1,14 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.UserViewModels +namespace SessionCompanion.ViewModels.UserViewModels { public class UserViewModel { + /// + /// Identyfikator użytkownika + /// public int Id { get; set; } + + /// + /// Nazwa użytkowika + /// public string Nickname { get; set; } + + /// + /// Hasło użytkownika + /// public string Password { get; set; } } } diff --git a/SessionCompanion/SessionCompanion.ViewModels/WisdomViewModels/WisdomViewModel.cs b/SessionCompanion/SessionCompanion.ViewModels/WisdomViewModels/WisdomViewModel.cs index 4b38191..1ba8997 100644 --- a/SessionCompanion/SessionCompanion.ViewModels/WisdomViewModels/WisdomViewModel.cs +++ b/SessionCompanion/SessionCompanion.ViewModels/WisdomViewModels/WisdomViewModel.cs @@ -1,27 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Text; - -namespace SessionCompanion.ViewModels.WisdomViewModels +namespace SessionCompanion.ViewModels.WisdomViewModels { public class WisdomViewModel { + /// + /// Identyfikator mądrości postaci + /// public int Id { get; set; } + + /// + /// Identyfikator postaci + /// public int CharacterId { get; set; } + + /// + /// Wartość mądrości + /// public int Value { get; set; } + + /// + /// Modyfikator rzutów + /// public int Modification { get; set; } + + /// + /// Modyfikator rzutów obronnych + /// public int SavingThrows { get; set; } + + /// + /// Czy postać posiada biegłość w mądrości + /// public bool CanSaveThrows { get; set; } + + /// + /// Wartość umiejętności opieki nad zwierzętami + /// public int AnimalHandling { get; set; } + + /// + /// Czy postać posiada biegłość w opiece nad zwierzętami + /// public bool CanAnimalHandling { get; set; } + + /// + /// Wartość umiejętności intuicji + /// public int Insight { get; set; } + + /// + /// Czy postać posiada biegłość w intuicji + /// public bool CanInsight { get; set; } + + /// + /// Wartość umiejętności medycyny + /// public int Medicine { get; set; } + + /// + /// Czy postać posiada biegłość w medycynie + /// public bool CanMedicine { get; set; } + + /// + /// Wartość umiejętności percepcji + /// public int Perception { get; set; } + + /// + /// Czy postać posiada biegłość w percepcji + /// public bool CanPerception { get; set; } + + /// + /// Wartość umiejętności sztuki przetrwania + /// public int Survival { get; set; } + + /// + /// Czy postać posiada biegłość w sztuce przetrwania + /// public bool CanSurvival { get; set; } } } \ No newline at end of file diff --git a/SessionCompanion/SessionCompanion/Controllers/UserController.cs b/SessionCompanion/SessionCompanion/Controllers/UserController.cs index daedf97..00dff03 100644 --- a/SessionCompanion/SessionCompanion/Controllers/UserController.cs +++ b/SessionCompanion/SessionCompanion/Controllers/UserController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; using SessionCompanion.Services.Interfaces; +using System.Threading.Tasks; namespace SessionCompanion.Controllers { @@ -13,5 +14,13 @@ namespace SessionCompanion.Controllers { this._service = service; } + + [HttpGet("login")] + public async Task Login(string userName, string password) + { + var User = await _service.SearchUserByNickname(userName); + if (User.Password == password) { return Json(User.Id); } + return BadRequest(); + } } } \ No newline at end of file