diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/Account.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/Account.cs new file mode 100644 index 0000000..e96ec0f --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/Account.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public abstract class Account +{ + #region PROPERTIES + + [JsonPropertyName("username")] + public required string Username { get; set; } + + [JsonPropertyName("email")] + public required string Email { get; set; } + + [JsonPropertyName("description")] + public string? Description { get; set; } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountEmailRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountEmailRequest.cs new file mode 100644 index 0000000..bdf5bab --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountEmailRequest.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountEmailRequest +{ + #region PROPERTIES + + [JsonPropertyName("new_email")] + public string NewEmail { get; set; } + + [JsonPropertyName("password")] + public string Password { get; set; } + + #endregion + + + + #region PUBLIC METHODS + + public void UpdateAccount(Database.Model.Account.Account account) + { + account.Email = NewEmail; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountPasswordRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountPasswordRequest.cs new file mode 100644 index 0000000..e0048c1 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountPasswordRequest.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountPasswordRequest +{ + #region PROPERTIES + + [JsonPropertyName("old_password")] + public string OldPassword { get; set; } + + [JsonPropertyName("new_password")] + public string NewPassword { get; set; } + + [JsonPropertyName("new_password_confirmation")] + public string NewPasswordConfirmation { get; set; } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileBackgroundRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileBackgroundRequest.cs new file mode 100644 index 0000000..6f8ce7b --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileBackgroundRequest.cs @@ -0,0 +1,26 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountProfileBackgroundRequest +{ + #region PROPERTIES + + [JsonPropertyName("id")] + public required Guid Id { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + [SetsRequiredMembers] + public AccountProfileBackgroundRequest(Guid id) + { + Id = id; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileInfoRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileInfoRequest.cs new file mode 100644 index 0000000..e26f615 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfileInfoRequest.cs @@ -0,0 +1,42 @@ +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountProfileInfoRequest +{ + #region PROPERTIES + + [JsonPropertyName("description")] + public string? Description { get; set; } + + [JsonPropertyName("gender_id")] + public short? GenderId { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + public AccountProfileInfoRequest() { } + + public AccountProfileInfoRequest(AccountResponse accountResponse) + { + Description = accountResponse.Description; + GenderId = accountResponse.Gender?.Id; + } + + #endregion + + + + #region PUBLIC METHODS + + public void UpdateAccount(Database.Model.Account.Account account) + { + account.Description = Description; + account.GenderId = GenderId; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePictureRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePictureRequest.cs new file mode 100644 index 0000000..1fbea18 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountProfilePictureRequest.cs @@ -0,0 +1,33 @@ +using System.Diagnostics.CodeAnalysis; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountProfilePictureRequest : AccountProfilePicture +{ + #region CONSTRUCTORS + + public AccountProfilePictureRequest() {} + + [SetsRequiredMembers] + public AccountProfilePictureRequest(Picture image) + { + Image = image.Image; + MimeType = image.MimeType; + } + + #endregion + + + public Database.Model.Account.AccountProfilePicture CreateMediaPosterImage() => new Database.Model.Account.AccountProfilePicture + { + Image = Image, + MimeType = MimeType, + }; + + public void UpdateMediaPosterImage(Database.Model.Account.AccountProfilePicture item) + { + item.Image = Image; + item.MimeType = MimeType; + item.UploadDate = DateTime.UtcNow; + } +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountQueryParameters.cs new file mode 100644 index 0000000..88221db --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountQueryParameters.cs @@ -0,0 +1,67 @@ +using Microsoft.AspNetCore.Mvc; +using WatchIt.Common.Query; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountQueryParameters : QueryParameters +{ + #region PROPERTIES + + [FromQuery(Name = "username")] + public string? Username { get; set; } + + [FromQuery(Name = "email")] + public string? Email { get; set; } + + [FromQuery(Name = "description")] + public string? Description { get; set; } + + [FromQuery(Name = "gender_id")] + public short? GenderId { get; set; } + + [FromQuery(Name = "last_active")] + public DateOnly? LastActive { get; set; } + + [FromQuery(Name = "last_active_from")] + public DateOnly? LastActiveFrom { get; set; } + + [FromQuery(Name = "last_active_to")] + public DateOnly? LastActiveTo { get; set; } + + [FromQuery(Name = "creation_date")] + public DateOnly? CreationDate { get; set; } + + [FromQuery(Name = "creation_date_from")] + public DateOnly? CreationDateFrom { get; set; } + + [FromQuery(Name = "creation_date_to")] + public DateOnly? CreationDateTo { get; set; } + + [FromQuery(Name = "is_admin")] + public bool? IsAdmin { get; set; } + + #endregion + + + + #region PRIVATE METHODS + + protected override bool IsMeetingConditions(AccountResponse item) => + ( + TestStringWithRegex(item.Username, Username) + && + TestStringWithRegex(item.Email, Email) + && + TestStringWithRegex(item.Description, Description) + && + Test(item.Gender?.Id, GenderId) + && + TestComparable(item.LastActive, LastActive, LastActiveFrom, LastActiveTo) + && + TestComparable(item.CreationDate, CreationDate, CreationDateFrom, CreationDateTo) + && + Test(item.IsAdmin, IsAdmin) + ); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountResponse.cs new file mode 100644 index 0000000..8ab8756 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountResponse.cs @@ -0,0 +1,64 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genders; +using WatchIt.Common.Query; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountResponse : Account, IQueryOrderable +{ + #region PROPERTIES + + [JsonIgnore] + public static IDictionary> OrderableProperties { get; } = new Dictionary> + { + { "id", x => x.Id }, + { "username", x => x.Username }, + { "email", x => x.Email }, + { "description", x => x.Description }, + { "gender", x => x.Gender.Name }, + { "last_active", x => x.LastActive }, + { "creation_date", x => x.CreationDate }, + { "is_admin", x => x.IsAdmin } + }; + + + [JsonPropertyName("id")] + public required long Id { get; set; } + + [JsonPropertyName("gender")] + public GenderResponse? Gender { get; set; } + + [JsonPropertyName("last_active")] + public DateTime LastActive { get; set; } + + [JsonPropertyName("creation_date")] + public DateTime CreationDate { get; set; } + + [JsonPropertyName("is_admin")] + public bool IsAdmin { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + [JsonConstructor] + public AccountResponse() {} + + [SetsRequiredMembers] + public AccountResponse(Database.Model.Account.Account account) + { + Id = account.Id; + Username = account.Username; + Email = account.Email; + Description = account.Description; + Gender = account.Gender is not null ? new GenderResponse(account.Gender) : null; + LastActive = account.LastActive; + CreationDate = account.CreationDate; + IsAdmin = account.IsAdmin; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountUsernameRequest.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountUsernameRequest.cs new file mode 100644 index 0000000..5219594 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/AccountUsernameRequest.cs @@ -0,0 +1,27 @@ +using System.Text.Json.Serialization; + +namespace WatchIt.Common.Model.Accounts; + +public class AccountUsernameRequest +{ + #region PROPERTIES + + [JsonPropertyName("new_username")] + public string NewUsername { get; set; } + + [JsonPropertyName("password")] + public string Password { get; set; } + + #endregion + + + + #region PUBLIC METHODS + + public void UpdateAccount(Database.Model.Account.Account account) + { + account.Username = NewUsername; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Accounts/RegisterResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Accounts/RegisterResponse.cs index 335ed0c..b6d904e 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Accounts/RegisterResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Accounts/RegisterResponse.cs @@ -30,7 +30,7 @@ public class RegisterResponse public RegisterResponse() {} [SetsRequiredMembers] - public RegisterResponse(Account account) + public RegisterResponse(Database.Model.Account.Account account) { Id = account.Id; Username = account.Username; diff --git a/WatchIt.Common/WatchIt.Common.Model/Genres/GenreResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Genres/GenreResponse.cs index 022fa80..9bb7cba 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Genres/GenreResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Genres/GenreResponse.cs @@ -18,7 +18,7 @@ public class GenreResponse : Genre, IQueryOrderable [JsonPropertyName("id")] - public long Id { get; set; } + public short Id { get; set; } #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Media/MediaQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Media/MediaQueryParameters.cs index fcbfe10..b0952b0 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Media/MediaQueryParameters.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Media/MediaQueryParameters.cs @@ -54,6 +54,9 @@ public class MediaQueryParameters : QueryParameters [FromQuery(Name = "rating_count_to")] public long? RatingCountTo { get; set; } + + [FromQuery(Name = "genre")] + public IEnumerable? Genres { get; set; } #endregion @@ -78,6 +81,8 @@ public class MediaQueryParameters : QueryParameters TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) && TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestContains(Genres, item.Genres.Select(x => x.Id)) ); #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Media/MediaResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Media/MediaResponse.cs index fd10ae8..796c2b5 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Media/MediaResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Media/MediaResponse.cs @@ -1,7 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Rating; using WatchIt.Common.Query; +using WatchIt.Database.Model.Rating; namespace WatchIt.Common.Model.Media; @@ -31,6 +33,9 @@ public class MediaResponse : Media, IQueryOrderable [JsonPropertyName("rating")] public RatingResponse Rating { get; set; } + + [JsonPropertyName("genres")] + public IEnumerable Genres { get; set; } #endregion @@ -51,7 +56,10 @@ public class MediaResponse : Media, IQueryOrderable ReleaseDate = media.ReleaseDate; Length = media.Length; Type = mediaType; - Rating = RatingResponse.Create(media.RatingMedia); + Rating = RatingResponseBuilder.Initialize() + .Add(media.RatingMedia, x => x.Rating) + .Build(); + Genres = media.Genres.Select(x => new GenreResponse(x)).ToList(); } #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieQueryParameters.cs index ede62e0..35c239c 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieQueryParameters.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieQueryParameters.cs @@ -60,6 +60,9 @@ public class MovieQueryParameters : QueryParameters [FromQuery(Name = "rating_count_to")] public long? RatingCountTo { get; set; } + + [FromQuery(Name = "genre")] + public IEnumerable? Genres { get; set; } #endregion @@ -84,6 +87,8 @@ public class MovieQueryParameters : QueryParameters TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) && TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestContains(item.Genres.Select(x => x.Id), Genres) ); #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedQueryParameters.cs new file mode 100644 index 0000000..5c5d2b7 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedQueryParameters.cs @@ -0,0 +1,115 @@ +using Microsoft.AspNetCore.Mvc; +using WatchIt.Common.Query; + +namespace WatchIt.Common.Model.Movies; + +public class MovieRatedQueryParameters : QueryParameters +{ + #region PROPERTIES + + [FromQuery(Name = "title")] + public string? Title { get; set; } + + [FromQuery(Name = "original_title")] + public string? OriginalTitle { get; set; } + + [FromQuery(Name = "description")] + public string? Description { get; set; } + + [FromQuery(Name = "release_date")] + public DateOnly? ReleaseDate { get; set; } + + [FromQuery(Name = "release_date_from")] + public DateOnly? ReleaseDateFrom { get; set; } + + [FromQuery(Name = "release_date_to")] + public DateOnly? ReleaseDateTo { get; set; } + + [FromQuery(Name = "length")] + public short? Length { get; set; } + + [FromQuery(Name = "length_from")] + public short? LengthFrom { get; set; } + + [FromQuery(Name = "length_to")] + public short? LengthTo { get; set; } + + [FromQuery(Name = "budget")] + public decimal? Budget { get; set; } + + [FromQuery(Name = "budget_from")] + public decimal? BudgetFrom { get; set; } + + [FromQuery(Name = "budget_to")] + public decimal? BudgetTo { get; set; } + + [FromQuery(Name = "rating_average")] + public decimal? RatingAverage { get; set; } + + [FromQuery(Name = "rating_average_from")] + public decimal? RatingAverageFrom { get; set; } + + [FromQuery(Name = "rating_average_to")] + public decimal? RatingAverageTo { get; set; } + + [FromQuery(Name = "rating_count")] + public long? RatingCount { get; set; } + + [FromQuery(Name = "rating_count_from")] + public long? RatingCountFrom { get; set; } + + [FromQuery(Name = "rating_count_to")] + public long? RatingCountTo { get; set; } + + [FromQuery(Name = "genre")] + public IEnumerable? Genres { get; set; } + + [FromQuery(Name = "user_rating")] + public decimal? UserRating { get; set; } + + [FromQuery(Name = "user_rating_from")] + public decimal? UserRatingFrom { get; set; } + + [FromQuery(Name = "user_rating_to")] + public decimal? UserRatingTo { get; set; } + + [FromQuery(Name = "user_rating_date")] + public DateOnly? UserRatingDate { get; set; } + + [FromQuery(Name = "user_rating_date_from")] + public DateOnly? UserRatingDateFrom { get; set; } + + [FromQuery(Name = "user_rating_date_to")] + public DateOnly? UserRatingDateTo { get; set; } + + #endregion + + + + #region PRIVATE METHODS + + protected override bool IsMeetingConditions(MovieRatedResponse item) => + ( + TestStringWithRegex(item.Title, Title) + && + TestStringWithRegex(item.OriginalTitle, OriginalTitle) + && + TestStringWithRegex(item.Description, Description) + && + TestComparable(item.ReleaseDate, ReleaseDate, ReleaseDateFrom, ReleaseDateTo) + && + TestComparable(item.Length, Length, LengthFrom, LengthTo) + && + TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) + && + TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestContains(Genres, item.Genres.Select(x => x.Id)) + && + TestComparable((decimal)item.UserRating, UserRating, UserRatingFrom, UserRatingTo) + && + TestComparable(item.UserRatingDate, UserRatingDate, UserRatingDateFrom, UserRatingDateTo) + ); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedResponse.cs new file mode 100644 index 0000000..5f3fa18 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieRatedResponse.cs @@ -0,0 +1,65 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genres; +using WatchIt.Common.Model.Rating; +using WatchIt.Common.Query; +using WatchIt.Database.Model.Media; +using WatchIt.Database.Model.Rating; + +namespace WatchIt.Common.Model.Movies; + +public class MovieRatedResponse : MovieResponse, IQueryOrderable +{ + #region PROPERTIES + + [JsonIgnore] + public static IDictionary> OrderableProperties { get; } = new Dictionary> + { + { "id", x => x.Id }, + { "title", x => x.Title }, + { "original_title", x => x.OriginalTitle }, + { "description", x => x.Description }, + { "release_date", x => x.ReleaseDate }, + { "length", x => x.Length }, + { "budget", x => x.Budget }, + { "rating.average", x => x.Rating.Average }, + { "rating.count", x => x.Rating.Count }, + { "user_rating", x => x.UserRating }, + { "user_rating_date", x => x.UserRatingDate } + }; + + [JsonPropertyName("user_rating")] + public short UserRating { get; set; } + + [JsonPropertyName("user_rating_date")] + public DateTime UserRatingDate { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + [JsonConstructor] + public MovieRatedResponse() { } + + [SetsRequiredMembers] + public MovieRatedResponse(MediaMovie mediaMovie, RatingMedia response) + { + Id = mediaMovie.Media.Id; + Title = mediaMovie.Media.Title; + OriginalTitle = mediaMovie.Media.OriginalTitle; + Description = mediaMovie.Media.Description; + ReleaseDate = mediaMovie.Media.ReleaseDate; + Length = mediaMovie.Media.Length; + Budget = mediaMovie.Budget; + Rating = RatingResponseBuilder.Initialize() + .Add(mediaMovie.Media.RatingMedia, x => x.Rating) + .Build(); + Genres = mediaMovie.Media.Genres.Select(x => new GenreResponse(x)).ToList(); + UserRating = response.Rating; + UserRatingDate = response.Date; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieResponse.cs index 366b058..a05e782 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Movies/MovieResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Movies/MovieResponse.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Rating; using WatchIt.Common.Query; using WatchIt.Database.Model.Media; @@ -30,6 +31,9 @@ public class MovieResponse : Movie, IQueryOrderable [JsonPropertyName("rating")] public RatingResponse Rating { get; set; } + + [JsonPropertyName("genres")] + public IEnumerable Genres { get; set; } #endregion @@ -50,7 +54,10 @@ public class MovieResponse : Movie, IQueryOrderable ReleaseDate = mediaMovie.Media.ReleaseDate; Length = mediaMovie.Media.Length; Budget = mediaMovie.Budget; - Rating = RatingResponse.Create(mediaMovie.Media.RatingMedia); + Rating = RatingResponseBuilder.Initialize() + .Add(mediaMovie.Media.RatingMedia, x => x.Rating) + .Build(); + Genres = mediaMovie.Media.Genres.Select(x => new GenreResponse(x)).ToList(); } #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedQueryParameters.cs new file mode 100644 index 0000000..dd1659b --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedQueryParameters.cs @@ -0,0 +1,117 @@ +using Microsoft.AspNetCore.Mvc; +using WatchIt.Common.Query; + +namespace WatchIt.Common.Model.Persons; + +public class PersonRatedQueryParameters : QueryParameters +{ + #region PROPERTIES + + [FromQuery(Name = "name")] + public string? Name { get; set; } + + [FromQuery(Name = "full_name")] + public string? FullName { get; set; } + + [FromQuery(Name = "description")] + public string? Description { get; set; } + + [FromQuery(Name = "birth_date")] + public DateOnly? BirthDate { get; set; } + + [FromQuery(Name = "birth_date_from")] + public DateOnly? BirthDateFrom { get; set; } + + [FromQuery(Name = "birth_date_to")] + public DateOnly? BirthDateTo { get; set; } + + [FromQuery(Name = "death_date")] + public DateOnly? DeathDate { get; set; } + + [FromQuery(Name = "death_date_from")] + public DateOnly? DeathDateFrom { get; set; } + + [FromQuery(Name = "death_date_to")] + public DateOnly? DeathDateTo { get; set; } + + [FromQuery(Name = "gender_id")] + public short? GenderId { get; set; } + + [FromQuery(Name = "rating_average")] + public decimal? RatingAverage { get; set; } + + [FromQuery(Name = "rating_average_from")] + public decimal? RatingAverageFrom { get; set; } + + [FromQuery(Name = "rating_average_to")] + public decimal? RatingAverageTo { get; set; } + + [FromQuery(Name = "rating_count")] + public long? RatingCount { get; set; } + + [FromQuery(Name = "rating_count_from")] + public long? RatingCountFrom { get; set; } + + [FromQuery(Name = "rating_count_to")] + public long? RatingCountTo { get; set; } + + [FromQuery(Name = "user_rating_average")] + public decimal? UserRatingAverage { get; set; } + + [FromQuery(Name = "user_rating_average_from")] + public decimal? UserRatingAverageFrom { get; set; } + + [FromQuery(Name = "user_rating_average_to")] + public decimal? UserRatingAverageTo { get; set; } + + [FromQuery(Name = "user_rating_count")] + public long? UserRatingCount { get; set; } + + [FromQuery(Name = "user_rating_count_from")] + public long? UserRatingCountFrom { get; set; } + + [FromQuery(Name = "user_rating_count_to")] + public long? UserRatingCountTo { get; set; } + + [FromQuery(Name = "user_rating_date")] + public DateOnly? UserRatingLastDate { get; set; } + + [FromQuery(Name = "user_rating_date_from")] + public DateOnly? UserRatingLastDateFrom { get; set; } + + [FromQuery(Name = "user_rating_date_to")] + public DateOnly? UserRatingLastDateTo { get; set; } + + #endregion + + + + #region PUBLIC METHODS + + protected override bool IsMeetingConditions(PersonRatedResponse item) => + ( + TestStringWithRegex(item.Name, Name) + && + TestStringWithRegex(item.FullName, FullName) + && + TestStringWithRegex(item.Description, Description) + && + TestComparable(item.BirthDate, BirthDate, BirthDateFrom, BirthDateTo) + && + TestComparable(item.DeathDate, DeathDate, DeathDateFrom, DeathDateTo) + && + Test(item.Gender?.Id, GenderId) + && + TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) + && + TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestComparable(item.UserRating.Average, UserRatingAverage, UserRatingAverageFrom, UserRatingAverageTo) + && + TestComparable(item.UserRating.Count, UserRatingCount, UserRatingCountFrom, UserRatingCountTo) + && + TestComparable(item.UserRatingLastDate, UserRatingLastDate, UserRatingLastDateFrom, UserRatingLastDateTo) + ); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedResponse.cs new file mode 100644 index 0000000..d328b95 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonRatedResponse.cs @@ -0,0 +1,70 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genders; +using WatchIt.Common.Model.Rating; +using WatchIt.Common.Query; +using WatchIt.Database.Model.Rating; + +namespace WatchIt.Common.Model.Persons; + +public class PersonRatedResponse : PersonResponse, IQueryOrderable +{ + #region PROPERTIES + + [JsonIgnore] + public static IDictionary> OrderableProperties { get; } = new Dictionary> + { + { "id", x => x.Id }, + { "name", x => x.Name }, + { "full_name", x => x.FullName }, + { "description", x => x.Description }, + { "birth_date", x => x.BirthDate }, + { "death_date", x => x.BirthDate }, + { "gender", x => x.Gender.Name }, + { "rating.average", x => x.Rating.Average }, + { "rating.count", x => x.Rating.Count }, + { "user_rating.average", x => x.UserRating.Average }, + { "user_rating.count", x => x.UserRating.Count }, + { "user_rating_last_date", x => x.UserRatingLastDate } + }; + + [JsonPropertyName("user_rating")] + public RatingResponse UserRating { get; set; } + + [JsonPropertyName("user_rating_last_date")] + public DateTime UserRatingLastDate { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + [JsonConstructor] + public PersonRatedResponse() { } + + [SetsRequiredMembers] + public PersonRatedResponse(Database.Model.Person.Person person, IEnumerable actorUserRatings, IEnumerable creatorUserRatings) + { + Id = person.Id; + Name = person.Name; + FullName = person.FullName; + Description = person.Description; + BirthDate = person.BirthDate; + DeathDate = person.DeathDate; + Gender = person.Gender is not null ? new GenderResponse(person.Gender) : null; + Rating = RatingResponseBuilder.Initialize() + .Add(person.PersonActorRoles.SelectMany(x => x.RatingPersonActorRole), x => x.Rating) + .Add(person.PersonCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole), x => x.Rating) + .Build(); + UserRating = RatingResponseBuilder.Initialize() + .Add(actorUserRatings, x => x.Rating) + .Add(creatorUserRatings, x => x.Rating) + .Build(); + UserRatingLastDate = actorUserRatings.Select(x => x.Date) + .Union(creatorUserRatings.Select(x => x.Date)) + .Max(); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Persons/PersonResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonResponse.cs index a81e5ab..1b3a264 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Persons/PersonResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Persons/PersonResponse.cs @@ -3,6 +3,7 @@ using System.Text.Json.Serialization; using WatchIt.Common.Model.Genders; using WatchIt.Common.Model.Rating; using WatchIt.Common.Query; +using WatchIt.Database.Model.Rating; namespace WatchIt.Common.Model.Persons; @@ -53,7 +54,10 @@ public class PersonResponse : Person, IQueryOrderable BirthDate = person.BirthDate; DeathDate = person.DeathDate; Gender = person.Gender is not null ? new GenderResponse(person.Gender) : null; - Rating = RatingResponse.Create(person.PersonActorRoles, person.PersonCreatorRoles); + Rating = RatingResponseBuilder.Initialize() + .Add(person.PersonActorRoles.SelectMany(x => x.RatingPersonActorRole), x => x.Rating) + .Add(person.PersonCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole), x => x.Rating) + .Build(); } #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs index 9037814..483f298 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponse.cs @@ -25,35 +25,11 @@ public class RatingResponse public RatingResponse() {} [SetsRequiredMembers] - private RatingResponse(long ratingSum, long ratingCount) + internal RatingResponse(long ratingSum, long ratingCount) { Average = ratingCount > 0 ? (decimal)ratingSum / ratingCount : 0; Count = ratingCount; } - public static RatingResponse Create(long ratingSum, long ratingCount) => new RatingResponse(ratingSum, ratingCount); - - public static RatingResponse Create(IEnumerable ratingMedia) => Create(ratingMedia, x => x.Rating); - - public static RatingResponse Create(IEnumerable ratingPersonActorRoles) => Create(ratingPersonActorRoles, x => x.Rating); - - public static RatingResponse Create(IEnumerable ratingPersonCreatorRoles) => Create(ratingPersonCreatorRoles, x => x.Rating); - - public static RatingResponse Create(IEnumerable ratingList, Func ratingSelector) => new RatingResponse(ratingList.Sum(x => ratingSelector(x)), ratingList.Count()); - - public static RatingResponse Create(IEnumerable personActorRoles, IEnumerable personCreatorRoles) - { - IEnumerable ratingsActorRoles = personActorRoles.SelectMany(x => x.RatingPersonActorRole); - IEnumerable ratingsCreatorRoles = personCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole); - return Create(ratingsActorRoles, ratingsCreatorRoles); - } - - public static RatingResponse Create(IEnumerable ratingsActorRoles, IEnumerable ratingsCreatorRoles) - { - long ratingSum = ratingsActorRoles.Sum(x => x.Rating) + ratingsCreatorRoles.Sum(x => x.Rating); - long ratingCount = ratingsActorRoles.Count() + ratingsCreatorRoles.Count(); - return new RatingResponse(ratingSum, ratingCount); - } - #endregion } \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponseBuilder.cs b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponseBuilder.cs new file mode 100644 index 0000000..d53b4df --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Rating/RatingResponseBuilder.cs @@ -0,0 +1,35 @@ +namespace WatchIt.Common.Model.Rating; + +public class RatingResponseBuilder +{ + #region FIELDS + + private long _sum; + private long _count; + + #endregion + + + + #region CONSTRUCTORS + + private RatingResponseBuilder() { } + + public static RatingResponseBuilder Initialize() => new RatingResponseBuilder(); + + #endregion + + + + #region PUBLIC METHODS + + public RatingResponseBuilder Add(IEnumerable collection, Func selector) + { + _sum += collection.Sum(x => selector(x)); + _count += collection.Count(); + return this; + } + public RatingResponse Build() => new RatingResponse(_sum, _count); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesQueryParameters.cs index 164a029..2cc5de4 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesQueryParameters.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesQueryParameters.cs @@ -54,6 +54,9 @@ public class SeriesQueryParameters : QueryParameters [FromQuery(Name = "rating_count_to")] public long? RatingCountTo { get; set; } + + [FromQuery(Name = "genre")] + public IEnumerable? Genres { get; set; } #endregion @@ -78,6 +81,8 @@ public class SeriesQueryParameters : QueryParameters TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) && TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestContains(item.Genres.Select(x => x.Id), Genres) ); #endregion diff --git a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedQueryParameters.cs b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedQueryParameters.cs new file mode 100644 index 0000000..b686626 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedQueryParameters.cs @@ -0,0 +1,111 @@ +using Microsoft.AspNetCore.Mvc; +using WatchIt.Common.Query; + +namespace WatchIt.Common.Model.Series; + +public class SeriesRatedQueryParameters : QueryParameters +{ + #region PROPERTIES + + [FromQuery(Name = "title")] + public string? Title { get; set; } + + [FromQuery(Name = "original_title")] + public string? OriginalTitle { get; set; } + + [FromQuery(Name = "description")] + public string? Description { get; set; } + + [FromQuery(Name = "release_date")] + public DateOnly? ReleaseDate { get; set; } + + [FromQuery(Name = "release_date_from")] + public DateOnly? ReleaseDateFrom { get; set; } + + [FromQuery(Name = "release_date_to")] + public DateOnly? ReleaseDateTo { get; set; } + + [FromQuery(Name = "length")] + public short? Length { get; set; } + + [FromQuery(Name = "length_from")] + public short? LengthFrom { get; set; } + + [FromQuery(Name = "length_to")] + public short? LengthTo { get; set; } + + [FromQuery(Name = "has_ended")] + public bool? HasEnded { get; set; } + + [FromQuery(Name = "rating_average")] + public decimal? RatingAverage { get; set; } + + [FromQuery(Name = "rating_average_from")] + public decimal? RatingAverageFrom { get; set; } + + [FromQuery(Name = "rating_average_to")] + public decimal? RatingAverageTo { get; set; } + + [FromQuery(Name = "rating_count")] + public long? RatingCount { get; set; } + + [FromQuery(Name = "rating_count_from")] + public long? RatingCountFrom { get; set; } + + [FromQuery(Name = "rating_count_to")] + public long? RatingCountTo { get; set; } + + [FromQuery(Name = "genre")] + public IEnumerable? Genres { get; set; } + + [FromQuery(Name = "user_rating")] + public decimal? UserRating { get; set; } + + [FromQuery(Name = "user_rating_from")] + public decimal? UserRatingFrom { get; set; } + + [FromQuery(Name = "user_rating_to")] + public decimal? UserRatingTo { get; set; } + + [FromQuery(Name = "user_rating_date")] + public DateOnly? UserRatingDate { get; set; } + + [FromQuery(Name = "user_rating_date_from")] + public DateOnly? UserRatingDateFrom { get; set; } + + [FromQuery(Name = "user_rating_date_to")] + public DateOnly? UserRatingDateTo { get; set; } + + #endregion + + + + #region PRIVATE METHODS + + protected override bool IsMeetingConditions(SeriesRatedResponse item) => + ( + TestStringWithRegex(item.Title, Title) + && + TestStringWithRegex(item.OriginalTitle, OriginalTitle) + && + TestStringWithRegex(item.Description, Description) + && + TestComparable(item.ReleaseDate, ReleaseDate, ReleaseDateFrom, ReleaseDateTo) + && + TestComparable(item.Length, Length, LengthFrom, LengthTo) + && + Test(item.HasEnded, HasEnded) + && + TestComparable(item.Rating.Average, RatingAverage, RatingAverageFrom, RatingAverageTo) + && + TestComparable(item.Rating.Count, RatingCount, RatingCountFrom, RatingCountTo) + && + TestContains(item.Genres.Select(x => x.Id), Genres) + && + TestComparable((decimal)item.UserRating, UserRating, UserRatingFrom, UserRatingTo) + && + TestComparable(item.UserRatingDate, UserRatingDate, UserRatingDateFrom, UserRatingDateTo) + ); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedResponse.cs new file mode 100644 index 0000000..8ac56a0 --- /dev/null +++ b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesRatedResponse.cs @@ -0,0 +1,65 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genres; +using WatchIt.Common.Model.Rating; +using WatchIt.Common.Query; +using WatchIt.Database.Model.Media; +using WatchIt.Database.Model.Rating; + +namespace WatchIt.Common.Model.Series; + +public class SeriesRatedResponse : SeriesResponse, IQueryOrderable +{ + #region PROPERTIES + + [JsonIgnore] + public static IDictionary> OrderableProperties { get; } = new Dictionary> + { + { "id", x => x.Id }, + { "title", x => x.Title }, + { "original_title", x => x.OriginalTitle }, + { "description", x => x.Description }, + { "release_date", x => x.ReleaseDate }, + { "length", x => x.Length }, + { "has_ended", x => x.HasEnded }, + { "rating.average", x => x.Rating.Average }, + { "rating.count", x => x.Rating.Count }, + { "user_rating", x => x.UserRating }, + { "user_rating_date", x => x.UserRatingDate } + }; + + [JsonPropertyName("user_rating")] + public short UserRating { get; set; } + + [JsonPropertyName("user_rating_date")] + public DateTime UserRatingDate { get; set; } + + #endregion + + + + #region CONSTRUCTORS + + [JsonConstructor] + public SeriesRatedResponse() { } + + [SetsRequiredMembers] + public SeriesRatedResponse(MediaSeries mediaSeries, RatingMedia response) + { + Id = mediaSeries.Media.Id; + Title = mediaSeries.Media.Title; + OriginalTitle = mediaSeries.Media.OriginalTitle; + Description = mediaSeries.Media.Description; + ReleaseDate = mediaSeries.Media.ReleaseDate; + Length = mediaSeries.Media.Length; + HasEnded = mediaSeries.HasEnded; + Rating = RatingResponseBuilder.Initialize() + .Add(mediaSeries.Media.RatingMedia, x => x.Rating) + .Build(); + Genres = mediaSeries.Media.Genres.Select(x => new GenreResponse(x)).ToList(); + UserRating = response.Rating; + UserRatingDate = response.Date; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesResponse.cs b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesResponse.cs index fe3fa4b..7f1c1e3 100644 --- a/WatchIt.Common/WatchIt.Common.Model/Series/SeriesResponse.cs +++ b/WatchIt.Common/WatchIt.Common.Model/Series/SeriesResponse.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; +using WatchIt.Common.Model.Genres; using WatchIt.Common.Model.Rating; using WatchIt.Common.Query; using WatchIt.Database.Model.Media; @@ -30,6 +31,9 @@ public class SeriesResponse : Series, IQueryOrderable [JsonPropertyName("rating")] public RatingResponse Rating { get; set; } + + [JsonPropertyName("genres")] + public IEnumerable Genres { get; set; } #endregion @@ -50,7 +54,10 @@ public class SeriesResponse : Series, IQueryOrderable ReleaseDate = mediaSeries.Media.ReleaseDate; Length = mediaSeries.Media.Length; HasEnded = mediaSeries.HasEnded; - Rating = RatingResponse.Create(mediaSeries.Media.RatingMedia); + Rating = RatingResponseBuilder.Initialize() + .Add(mediaSeries.Media.RatingMedia, x => x.Rating) + .Build(); + Genres = mediaSeries.Media.Genres.Select(x => new GenreResponse(x)).ToList(); } #endregion diff --git a/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs b/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs index c574197..4f27d62 100644 --- a/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs +++ b/WatchIt.Common/WatchIt.Common.Query/QueryParameters.cs @@ -1,4 +1,5 @@ -using System.Globalization; +using System.Collections; +using System.Globalization; using System.Reflection; using System.Text; using System.Text.Json.Serialization; @@ -39,13 +40,16 @@ public abstract class QueryParameters FromQueryAttribute? attribute = property.GetCustomAttributes(true).FirstOrDefault(); if (value is not null && attribute is not null) { - string valueString = (value switch + if (value is IEnumerable enumerable and not string) { - decimal d => d.ToString(CultureInfo.InvariantCulture), - _ => value.ToString() - })!; - string query = $"{attribute.Name}={valueString}"; - queries.Add(query); + IEnumerable arrayQueryElements = enumerable.Cast().Select(x => QueryElementToString(attribute.Name!, x.ToString())); + queries.AddRange(arrayQueryElements); + } + else + { + string query = QueryElementToString(attribute.Name!, value); + queries.Add(query); + } } } @@ -58,6 +62,18 @@ public abstract class QueryParameters #region PRIVATE METHODS + private string QueryElementToString(string name, object value) + { + string valueString = (value switch + { + decimal d => d.ToString(CultureInfo.InvariantCulture), + _ => value.ToString() + })!; + string query = $"{name}={valueString}"; + return query; + } + + protected static bool Test(T? property, T? query) => ( query is null @@ -113,6 +129,15 @@ public abstract class QueryParameters ) ); + protected static bool TestContains(IEnumerable? shouldBeInCollection, IEnumerable? collection) => + ( + collection is null + || + shouldBeInCollection is null + || + shouldBeInCollection.All(collection.Contains) + ); + #endregion } diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaConfiguration.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaConfiguration.cs index 7791626..67eaf19 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaConfiguration.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaConfiguration.cs @@ -30,5 +30,9 @@ public class RatingMediaConfiguration : IEntityTypeConfiguration builder.Property(x => x.Rating) .IsRequired(); + + builder.Property(x => x.Date) + .IsRequired() + .HasDefaultValueSql("now()"); } } \ No newline at end of file diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesEpisodeConfiguration.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesEpisodeConfiguration.cs index df2e5b0..c920705 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesEpisodeConfiguration.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesEpisodeConfiguration.cs @@ -30,5 +30,9 @@ public class RatingMediaSeriesEpisodeConfiguration : IEntityTypeConfiguration x.Rating) .IsRequired(); + + builder.Property(x => x.Date) + .IsRequired() + .HasDefaultValueSql("now()"); } } \ No newline at end of file diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesSeasonConfiguration.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesSeasonConfiguration.cs index b777a13..6da3070 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesSeasonConfiguration.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingMediaSeriesSeasonConfiguration.cs @@ -30,5 +30,9 @@ public class RatingMediaSeriesSeasonConfiguration : IEntityTypeConfiguration x.Rating) .IsRequired(); + + builder.Property(x => x.Date) + .IsRequired() + .HasDefaultValueSql("now()"); } } \ No newline at end of file diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonActorRoleConfiguration.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonActorRoleConfiguration.cs index 835914d..681f9f5 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonActorRoleConfiguration.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonActorRoleConfiguration.cs @@ -32,5 +32,9 @@ public class RatingPersonActorRoleConfiguration : IEntityTypeConfiguration x.Rating) .IsRequired(); + + builder.Property(x => x.Date) + .IsRequired() + .HasDefaultValueSql("now()"); } } \ No newline at end of file diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonCreatorRoleConfiguration.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonCreatorRoleConfiguration.cs index 8b871ba..708c2d4 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonCreatorRoleConfiguration.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model.Configuration/Rating/RatingPersonCreatorRoleConfiguration.cs @@ -32,5 +32,9 @@ public class RatingPersonCreatorRoleConfiguration : IEntityTypeConfiguration x.Rating) .IsRequired(); + + builder.Property(x => x.Date) + .IsRequired() + .HasDefaultValueSql("now()"); } } \ No newline at end of file diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Account/Account.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Account/Account.cs index c24a5ec..f7f5db4 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Account/Account.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Account/Account.cs @@ -15,9 +15,9 @@ public class Account public short? GenderId { get; set; } public Guid? ProfilePictureId { get; set; } public Guid? BackgroundPictureId { get; set; } - public required byte[] Password { get; set; } - public required string LeftSalt { get; set; } - public required string RightSalt { get; set; } + public byte[] Password { get; set; } + public string LeftSalt { get; set; } + public string RightSalt { get; set; } public bool IsAdmin { get; set; } = false; public DateTime CreationDate { get; set; } public DateTime LastActive { get; set; } diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMedia.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMedia.cs index f4e3b67..9e7b49e 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMedia.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMedia.cs @@ -8,6 +8,7 @@ public class RatingMedia public required long MediaId { get; set; } public required long AccountId { get; set; } public required short Rating { get; set; } + public DateTime Date { get; set; } #endregion diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesEpisode.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesEpisode.cs index 0a00901..6f40392 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesEpisode.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesEpisode.cs @@ -10,6 +10,7 @@ public class RatingMediaSeriesEpisode public required Guid MediaSeriesEpisodeId { get; set; } public required long AccountId { get; set; } public required short Rating { get; set; } + public DateTime Date { get; set; } #endregion diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesSeason.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesSeason.cs index f522e07..dae110f 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesSeason.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingMediaSeriesSeason.cs @@ -10,6 +10,7 @@ public class RatingMediaSeriesSeason public required Guid MediaSeriesSeasonId { get; set; } public required long AccountId { get; set; } public required short Rating { get; set; } + public DateTime Date { get; set; } #endregion diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonActorRole.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonActorRole.cs index 923c8ba..4624faf 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonActorRole.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonActorRole.cs @@ -10,6 +10,7 @@ public class RatingPersonActorRole public required Guid PersonActorRoleId { get; set; } public required long AccountId { get; set; } public required short Rating { get; set; } + public DateTime Date { get; set; } #endregion diff --git a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonCreatorRole.cs b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonCreatorRole.cs index b0b7ed2..c5b2399 100644 --- a/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonCreatorRole.cs +++ b/WatchIt.Database/WatchIt.Database.Model/WatchIt.Database.Model/Rating/RatingPersonCreatorRole.cs @@ -10,6 +10,7 @@ public class RatingPersonCreatorRole public required Guid PersonCreatorRoleId { get; set; } public required long AccountId { get; set; } public required short Rating { get; set; } + public DateTime Date { get; set; } #endregion diff --git a/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.Designer.cs b/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.Designer.cs new file mode 100644 index 0000000..d882d39 --- /dev/null +++ b/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.Designer.cs @@ -0,0 +1,1416 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using WatchIt.Database; + +#nullable disable + +namespace WatchIt.Database.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20241102132802_RatingDate")] + partial class RatingDate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.5") + .HasAnnotation("Proxies:ChangeTracking", false) + .HasAnnotation("Proxies:CheckEquality", false) + .HasAnnotation("Proxies:LazyLoading", true) + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BackgroundPictureId") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(320) + .HasColumnType("character varying(320)"); + + b.Property("GenderId") + .HasColumnType("smallint"); + + b.Property("IsAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("LastActive") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("LeftSalt") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(1000) + .HasColumnType("bytea"); + + b.Property("ProfilePictureId") + .HasColumnType("uuid"); + + b.Property("RightSalt") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("character varying(20)"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("BackgroundPictureId"); + + b.HasIndex("GenderId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("ProfilePictureId") + .IsUnique(); + + b.ToTable("Accounts"); + + b.HasData( + new + { + Id = 1L, + CreationDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Email = "root@watch.it", + IsAdmin = true, + LastActive = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + LeftSalt = "YuJiv1\"R'*0odl8${\\|S", + Password = new byte[] { 215, 154, 186, 191, 12, 223, 76, 105, 137, 67, 41, 138, 26, 3, 38, 36, 0, 71, 40, 84, 153, 152, 105, 239, 55, 60, 164, 15, 99, 175, 133, 175, 227, 245, 102, 9, 171, 119, 16, 234, 97, 179, 70, 29, 120, 112, 241, 91, 209, 91, 228, 164, 52, 244, 36, 207, 147, 60, 124, 66, 77, 252, 129, 151 }, + RightSalt = "oT2N=y7^5,2o'+N>d}~!", + Username = "root" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.AccountProfilePicture", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Image") + .IsRequired() + .HasMaxLength(-1) + .HasColumnType("bytea"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UploadDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("AccountProfilePictures"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.AccountRefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("IsExtendable") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("AccountRefreshTokens"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Common.Country", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("IsHistorical") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("Countries"); + + b.HasData( + new + { + Id = (short)1, + IsHistorical = false, + Name = "Afghanistan" + }, + new + { + Id = (short)2, + IsHistorical = false, + Name = "Albania" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Common.Gender", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("Genders"); + + b.HasData( + new + { + Id = (short)1, + Name = "Male" + }, + new + { + Id = (short)2, + Name = "Female" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Common.Genre", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("Genres"); + + b.HasData( + new + { + Id = (short)1, + Name = "Comedy" + }, + new + { + Id = (short)2, + Name = "Thriller" + }, + new + { + Id = (short)3, + Name = "Horror" + }, + new + { + Id = (short)4, + Name = "Action" + }, + new + { + Id = (short)5, + Name = "Drama" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("Length") + .HasColumnType("smallint"); + + b.Property("MediaPosterImageId") + .HasColumnType("uuid"); + + b.Property("OriginalTitle") + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.Property("ReleaseDate") + .HasColumnType("date"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(250) + .HasColumnType("character varying(250)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaPosterImageId") + .IsUnique(); + + b.ToTable("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaGenre", b => + { + b.Property("GenreId") + .HasColumnType("smallint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.HasKey("GenreId", "MediaId"); + + b.HasIndex("MediaId"); + + b.ToTable("MediaGenres"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaMovie", b => + { + b.Property("Id") + .HasColumnType("bigint"); + + b.Property("Budget") + .HasColumnType("money"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("MediaMovies"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Image") + .IsRequired() + .HasMaxLength(-1) + .HasColumnType("bytea"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UploadDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaId"); + + b.ToTable("MediaPhotoImages"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("FirstGradientColor") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("bytea"); + + b.Property("IsUniversalBackground") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SecondGradientColor") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("bytea"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("MediaPhotoImageBackgrounds"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Image") + .IsRequired() + .HasMaxLength(-1) + .HasColumnType("bytea"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UploadDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("MediaPosterImages"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b => + { + b.Property("CountryId") + .HasColumnType("smallint"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.HasKey("CountryId", "MediaId"); + + b.HasIndex("MediaId"); + + b.ToTable("MediaProductionCountries"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b => + { + b.Property("Id") + .HasColumnType("bigint"); + + b.Property("HasEnded") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("MediaSeries"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("IsSpecial") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("MediaSeriesSeasonId") + .HasColumnType("uuid"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Number") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaSeriesSeasonId"); + + b.ToTable("MediaSeriesEpisodes"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("MediaSeriesId") + .HasColumnType("bigint"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Number") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaSeriesId"); + + b.ToTable("MediaSeriesSeasons"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BirthDate") + .HasColumnType("date"); + + b.Property("DeathDate") + .HasColumnType("date"); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("FullName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("GenderId") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("PersonPhotoId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("GenderId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("PersonPhotoId") + .IsUnique(); + + b.ToTable("Persons"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("PersonActorRoleTypeId") + .HasColumnType("smallint"); + + b.Property("PersonId") + .HasColumnType("bigint"); + + b.Property("RoleName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaId"); + + b.HasIndex("PersonActorRoleTypeId"); + + b.HasIndex("PersonId"); + + b.ToTable("PersonActorRoles"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRoleType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("PersonActorRoleTypes"); + + b.HasData( + new + { + Id = (short)1, + Name = "Actor" + }, + new + { + Id = (short)2, + Name = "Supporting actor" + }, + new + { + Id = (short)3, + Name = "Voice actor" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("PersonCreatorRoleTypeId") + .HasColumnType("smallint"); + + b.Property("PersonId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaId"); + + b.HasIndex("PersonCreatorRoleTypeId"); + + b.HasIndex("PersonId"); + + b.ToTable("PersonCreatorRoles"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRoleType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("smallint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("PersonCreatorRoleTypes"); + + b.HasData( + new + { + Id = (short)1, + Name = "Director" + }, + new + { + Id = (short)2, + Name = "Producer" + }, + new + { + Id = (short)3, + Name = "Screenwriter" + }); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonPhotoImage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Image") + .IsRequired() + .HasMaxLength(-1) + .HasColumnType("bytea"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UploadDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("PersonPhotoImages"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("Rating") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaId"); + + b.ToTable("RatingsMedia"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesEpisode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("MediaSeriesEpisodeId") + .HasColumnType("uuid"); + + b.Property("Rating") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaSeriesEpisodeId"); + + b.ToTable("RatingsMediaSeriesEpisode"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesSeason", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("MediaSeriesSeasonId") + .HasColumnType("uuid"); + + b.Property("Rating") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaSeriesSeasonId"); + + b.ToTable("RatingsMediaSeriesSeason"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonActorRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PersonActorRoleId") + .HasColumnType("uuid"); + + b.Property("Rating") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("PersonActorRoleId"); + + b.ToTable("RatingsPersonActorRole", (string)null); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonCreatorRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccountId") + .HasColumnType("bigint"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + + b.Property("PersonCreatorRoleId") + .HasColumnType("uuid"); + + b.Property("Rating") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("PersonCreatorRoleId"); + + b.ToTable("RatingsPersonCreatorRole", (string)null); + }); + + modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountMedia", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("date") + .HasDefaultValueSql("now()"); + + b.Property("MediaId") + .HasColumnType("bigint"); + + b.Property("ViewCount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("MediaId"); + + b.ToTable("ViewCountsMedia", (string)null); + }); + + modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountPerson", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("date") + .HasDefaultValueSql("now()"); + + b.Property("PersonId") + .HasColumnType("bigint"); + + b.Property("ViewCount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L); + + b.HasKey("Id"); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("PersonId"); + + b.ToTable("ViewCountsPerson", (string)null); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b => + { + b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "BackgroundPicture") + .WithMany() + .HasForeignKey("BackgroundPictureId"); + + b.HasOne("WatchIt.Database.Model.Common.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("WatchIt.Database.Model.Account.AccountProfilePicture", "ProfilePicture") + .WithOne("Account") + .HasForeignKey("WatchIt.Database.Model.Account.Account", "ProfilePictureId"); + + b.Navigation("BackgroundPicture"); + + b.Navigation("Gender"); + + b.Navigation("ProfilePicture"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.AccountRefreshToken", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("AccountRefreshTokens") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b => + { + b.HasOne("WatchIt.Database.Model.Media.MediaPosterImage", "MediaPosterImage") + .WithOne("Media") + .HasForeignKey("WatchIt.Database.Model.Media.Media", "MediaPosterImageId"); + + b.Navigation("MediaPosterImage"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaGenre", b => + { + b.HasOne("WatchIt.Database.Model.Common.Genre", "Genre") + .WithMany("MediaGenres") + .HasForeignKey("GenreId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("MediaGenres") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Genre"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaMovie", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithOne() + .HasForeignKey("WatchIt.Database.Model.Media.MediaMovie", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("MediaPhotoImages") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImageBackground", b => + { + b.HasOne("WatchIt.Database.Model.Media.MediaPhotoImage", "MediaPhotoImage") + .WithOne("MediaPhotoImageBackground") + .HasForeignKey("WatchIt.Database.Model.Media.MediaPhotoImageBackground", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaPhotoImage"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaProductionCountry", b => + { + b.HasOne("WatchIt.Database.Model.Common.Country", "Country") + .WithMany("MediaProductionCountries") + .HasForeignKey("CountryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("MediaProductionCountries") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Country"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithOne() + .HasForeignKey("WatchIt.Database.Model.Media.MediaSeries", "Id") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b => + { + b.HasOne("WatchIt.Database.Model.Media.MediaSeriesSeason", "MediaSeriesSeason") + .WithMany("MediaSeriesEpisodes") + .HasForeignKey("MediaSeriesSeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaSeriesSeason"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b => + { + b.HasOne("WatchIt.Database.Model.Media.MediaSeries", "MediaSeries") + .WithMany("MediaSeriesSeasons") + .HasForeignKey("MediaSeriesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("MediaSeries"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b => + { + b.HasOne("WatchIt.Database.Model.Common.Gender", "Gender") + .WithMany() + .HasForeignKey("GenderId"); + + b.HasOne("WatchIt.Database.Model.Person.PersonPhotoImage", "PersonPhoto") + .WithOne("Person") + .HasForeignKey("WatchIt.Database.Model.Person.Person", "PersonPhotoId"); + + b.Navigation("Gender"); + + b.Navigation("PersonPhoto"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("PersonActorRoles") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.PersonActorRoleType", "PersonActorRoleType") + .WithMany() + .HasForeignKey("PersonActorRoleTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.Person", "Person") + .WithMany("PersonActorRoles") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Person"); + + b.Navigation("PersonActorRoleType"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("PersonCreatorRoles") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.PersonCreatorRoleType", "PersonCreatorRoleType") + .WithMany() + .HasForeignKey("PersonCreatorRoleTypeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.Person", "Person") + .WithMany("PersonCreatorRoles") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + + b.Navigation("Person"); + + b.Navigation("PersonCreatorRoleType"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMedia", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("RatingMedia") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("RatingMedia") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesEpisode", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("RatingMediaSeriesEpisode") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Media.MediaSeriesEpisode", "MediaSeriesEpisode") + .WithMany("RatingMediaSeriesEpisode") + .HasForeignKey("MediaSeriesEpisodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + + b.Navigation("MediaSeriesEpisode"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingMediaSeriesSeason", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("RatingMediaSeriesSeason") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Media.MediaSeriesSeason", "MediaSeriesSeason") + .WithMany("RatingMediaSeriesSeason") + .HasForeignKey("MediaSeriesSeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + + b.Navigation("MediaSeriesSeason"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonActorRole", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("RatingPersonActorRole") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.PersonActorRole", "PersonActorRole") + .WithMany("RatingPersonActorRole") + .HasForeignKey("PersonActorRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + + b.Navigation("PersonActorRole"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Rating.RatingPersonCreatorRole", b => + { + b.HasOne("WatchIt.Database.Model.Account.Account", "Account") + .WithMany("RatingPersonCreatorRole") + .HasForeignKey("AccountId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("WatchIt.Database.Model.Person.PersonCreatorRole", "PersonCreatorRole") + .WithMany("RatingPersonCreatorRole") + .HasForeignKey("PersonCreatorRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + + b.Navigation("PersonCreatorRole"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountMedia", b => + { + b.HasOne("WatchIt.Database.Model.Media.Media", "Media") + .WithMany("ViewCountsMedia") + .HasForeignKey("MediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Media"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.ViewCount.ViewCountPerson", b => + { + b.HasOne("WatchIt.Database.Model.Person.Person", "Person") + .WithMany("ViewCountsPerson") + .HasForeignKey("PersonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Person"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.Account", b => + { + b.Navigation("AccountRefreshTokens"); + + b.Navigation("RatingMedia"); + + b.Navigation("RatingMediaSeriesEpisode"); + + b.Navigation("RatingMediaSeriesSeason"); + + b.Navigation("RatingPersonActorRole"); + + b.Navigation("RatingPersonCreatorRole"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Account.AccountProfilePicture", b => + { + b.Navigation("Account") + .IsRequired(); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Common.Country", b => + { + b.Navigation("MediaProductionCountries"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Common.Genre", b => + { + b.Navigation("MediaGenres"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.Media", b => + { + b.Navigation("MediaGenres"); + + b.Navigation("MediaPhotoImages"); + + b.Navigation("MediaProductionCountries"); + + b.Navigation("PersonActorRoles"); + + b.Navigation("PersonCreatorRoles"); + + b.Navigation("RatingMedia"); + + b.Navigation("ViewCountsMedia"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPhotoImage", b => + { + b.Navigation("MediaPhotoImageBackground"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaPosterImage", b => + { + b.Navigation("Media") + .IsRequired(); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeries", b => + { + b.Navigation("MediaSeriesSeasons"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesEpisode", b => + { + b.Navigation("RatingMediaSeriesEpisode"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Media.MediaSeriesSeason", b => + { + b.Navigation("MediaSeriesEpisodes"); + + b.Navigation("RatingMediaSeriesSeason"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.Person", b => + { + b.Navigation("PersonActorRoles"); + + b.Navigation("PersonCreatorRoles"); + + b.Navigation("ViewCountsPerson"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonActorRole", b => + { + b.Navigation("RatingPersonActorRole"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonCreatorRole", b => + { + b.Navigation("RatingPersonCreatorRole"); + }); + + modelBuilder.Entity("WatchIt.Database.Model.Person.PersonPhotoImage", b => + { + b.Navigation("Person") + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.cs b/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.cs new file mode 100644 index 0000000..8262578 --- /dev/null +++ b/WatchIt.Database/WatchIt.Database/Migrations/20241102132802_RatingDate.cs @@ -0,0 +1,92 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace WatchIt.Database.Migrations +{ + /// + public partial class RatingDate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Date", + table: "RatingsPersonCreatorRole", + type: "timestamp with time zone", + nullable: false, + defaultValueSql: "now()"); + + migrationBuilder.AddColumn( + name: "Date", + table: "RatingsPersonActorRole", + type: "timestamp with time zone", + nullable: false, + defaultValueSql: "now()"); + + migrationBuilder.AddColumn( + name: "Date", + table: "RatingsMediaSeriesSeason", + type: "timestamp with time zone", + nullable: false, + defaultValueSql: "now()"); + + migrationBuilder.AddColumn( + name: "Date", + table: "RatingsMediaSeriesEpisode", + type: "timestamp with time zone", + nullable: false, + defaultValueSql: "now()"); + + migrationBuilder.AddColumn( + name: "Date", + table: "RatingsMedia", + type: "timestamp with time zone", + nullable: false, + defaultValueSql: "now()"); + + migrationBuilder.AlterColumn( + name: "RoleName", + table: "PersonActorRoles", + type: "character varying(100)", + maxLength: 100, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Date", + table: "RatingsPersonCreatorRole"); + + migrationBuilder.DropColumn( + name: "Date", + table: "RatingsPersonActorRole"); + + migrationBuilder.DropColumn( + name: "Date", + table: "RatingsMediaSeriesSeason"); + + migrationBuilder.DropColumn( + name: "Date", + table: "RatingsMediaSeriesEpisode"); + + migrationBuilder.DropColumn( + name: "Date", + table: "RatingsMedia"); + + migrationBuilder.AlterColumn( + name: "RoleName", + table: "PersonActorRoles", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(100)", + oldMaxLength: 100); + } + } +} diff --git a/WatchIt.Database/WatchIt.Database/Migrations/DatabaseContextModelSnapshot.cs b/WatchIt.Database/WatchIt.Database/Migrations/DatabaseContextModelSnapshot.cs index dce4d31..40c20dc 100644 --- a/WatchIt.Database/WatchIt.Database/Migrations/DatabaseContextModelSnapshot.cs +++ b/WatchIt.Database/WatchIt.Database/Migrations/DatabaseContextModelSnapshot.cs @@ -108,9 +108,9 @@ namespace WatchIt.Database.Migrations Email = "root@watch.it", IsAdmin = true, LastActive = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - LeftSalt = "@(0PF{b6Ot?HO*:yF5`L", - Password = new byte[] { 254, 122, 19, 59, 187, 100, 174, 87, 55, 108, 14, 10, 123, 186, 129, 243, 145, 136, 152, 220, 72, 170, 196, 93, 54, 88, 192, 115, 128, 76, 133, 9, 181, 99, 181, 8, 102, 123, 197, 251, 85, 167, 146, 28, 116, 249, 118, 87, 146, 8, 194, 238, 127, 19, 33, 28, 14, 222, 218, 170, 74, 40, 223, 232 }, - RightSalt = "=pt,3T0#CfC1[}Zfp{/u", + LeftSalt = "YuJiv1\"R'*0odl8${\\|S", + Password = new byte[] { 215, 154, 186, 191, 12, 223, 76, 105, 137, 67, 41, 138, 26, 3, 38, 36, 0, 71, 40, 84, 153, 152, 105, 239, 55, 60, 164, 15, 99, 175, 133, 175, 227, 245, 102, 9, 171, 119, 16, 234, 97, 179, 70, 29, 120, 112, 241, 91, 209, 91, 228, 164, 52, 244, 36, 207, 147, 60, 124, 66, 77, 252, 129, 151 }, + RightSalt = "oT2N=y7^5,2o'+N>d}~!", Username = "root" }); }); @@ -607,7 +607,8 @@ namespace WatchIt.Database.Migrations b.Property("RoleName") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(100) + .HasColumnType("character varying(100)"); b.HasKey("Id"); @@ -766,6 +767,11 @@ namespace WatchIt.Database.Migrations b.Property("AccountId") .HasColumnType("bigint"); + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + b.Property("MediaId") .HasColumnType("bigint"); @@ -793,6 +799,11 @@ namespace WatchIt.Database.Migrations b.Property("AccountId") .HasColumnType("bigint"); + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + b.Property("MediaSeriesEpisodeId") .HasColumnType("uuid"); @@ -820,6 +831,11 @@ namespace WatchIt.Database.Migrations b.Property("AccountId") .HasColumnType("bigint"); + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + b.Property("MediaSeriesSeasonId") .HasColumnType("uuid"); @@ -847,6 +863,11 @@ namespace WatchIt.Database.Migrations b.Property("AccountId") .HasColumnType("bigint"); + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + b.Property("PersonActorRoleId") .HasColumnType("uuid"); @@ -874,6 +895,11 @@ namespace WatchIt.Database.Migrations b.Property("AccountId") .HasColumnType("bigint"); + b.Property("Date") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("now()"); + b.Property("PersonCreatorRoleId") .HasColumnType("uuid"); diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs index d1a3de0..a57a424 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Controllers/AccountsController.cs @@ -1,7 +1,12 @@ -using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Movies; +using WatchIt.Common.Model.Persons; +using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Series; using WatchIt.WebAPI.Services.Controllers.Accounts; namespace WatchIt.WebAPI.Controllers; @@ -10,6 +15,8 @@ namespace WatchIt.WebAPI.Controllers; [Route("accounts")] public class AccountsController(IAccountsControllerService accountsControllerService) : ControllerBase { + #region Basic + [HttpPost("register")] [AllowAnonymous] [ProducesResponseType(typeof(RegisterResponse), StatusCodes.Status201Created)] @@ -23,7 +30,7 @@ public class AccountsController(IAccountsControllerService accountsControllerSer [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] public async Task Authenticate([FromBody]AuthenticateRequest body) => await accountsControllerService.Authenticate(body); - [HttpPost("authenticate-refresh")] + [HttpPost("authenticate_refresh")] [Authorize(AuthenticationSchemes = "refresh")] [ProducesResponseType(typeof(AuthenticateResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] @@ -35,10 +42,114 @@ public class AccountsController(IAccountsControllerService accountsControllerSer [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] public async Task Logout() => await accountsControllerService.Logout(); - [HttpGet("{id}/profile-picture")] + #endregion + + #region Profile picture + + [HttpGet("{id}/profile_picture")] [AllowAnonymous] [ProducesResponseType(typeof(AccountProfilePictureResponse), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task GetAccountProfilePicture([FromRoute(Name = "id")]long id) => await accountsControllerService.GetAccountProfilePicture(id); + + [HttpPut("profile_picture")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(typeof(AccountProfilePictureResponse), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] + public async Task PutAccountProfilePicture([FromBody]AccountProfilePictureRequest body) => await accountsControllerService.PutAccountProfilePicture(body); + + [HttpDelete("profile_picture")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] + [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] + public async Task DeleteAccountProfilePicture() => await accountsControllerService.DeleteAccountProfilePicture(); + + #endregion + + #region Profile background + + [HttpGet("{id}/profile_background")] + [AllowAnonymous] + [ProducesResponseType(typeof(PhotoResponse), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetAccountProfileBackground([FromRoute(Name = "id")]long id) => await accountsControllerService.GetAccountProfileBackground(id); + + [HttpPut("profile_background")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(typeof(PhotoResponse), StatusCodes.Status200OK)] + [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] + public async Task PutAccountProfileBackground([FromBody]AccountProfileBackgroundRequest body) => await accountsControllerService.PutAccountProfileBackground(body); + + [HttpDelete("profile_background")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(typeof(void), StatusCodes.Status204NoContent)] + [ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)] + public async Task DeleteAccountProfileBackground() => await accountsControllerService.DeleteAccountProfileBackground(); + + #endregion + + #region Info + + [HttpGet] + [AllowAnonymous] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + public async Task GetAccounts(AccountQueryParameters query) => await accountsControllerService.GetAccounts(query); + + [HttpGet("{id}")] + [AllowAnonymous] + [ProducesResponseType(typeof(AccountResponse), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetAccount([FromRoute]long id) => await accountsControllerService.GetAccount(id); + + [HttpPut("profile_info")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task PutAccountProfileInfo([FromBody]AccountProfileInfoRequest data) => await accountsControllerService.PutAccountProfileInfo(data); + + [HttpPatch("username")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task PatchAccountUsername([FromBody]AccountUsernameRequest data) => await accountsControllerService.PatchAccountUsername(data); + + [HttpPatch("email")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task PatchAccountEmail([FromBody]AccountEmailRequest data) => await accountsControllerService.PatchAccountEmail(data); + + [HttpPatch("password")] + [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + public async Task PatchAccountPassword([FromBody]AccountPasswordRequest data) => await accountsControllerService.PatchAccountPassword(data); + + #endregion + + [HttpGet("{id}/movies")] + [AllowAnonymous] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetAccountRatedMovies([FromRoute]long id, MovieRatedQueryParameters query) => await accountsControllerService.GetAccountRatedMovies(id, query); + + [HttpGet("{id}/series")] + [AllowAnonymous] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetAccountRatedSeries([FromRoute]long id, SeriesRatedQueryParameters query) => await accountsControllerService.GetAccountRatedSeries(id, query); + + [HttpGet("{id}/persons")] + [AllowAnonymous] + [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public async Task GetAccountRatedPersons([FromRoute]long id, PersonRatedQueryParameters query) => await accountsControllerService.GetAccountRatedPersons(id, query); } \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs index 3cbdf70..14fc4ba 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/AccountsControllerService.cs @@ -5,13 +5,22 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using SimpleToolkit.Extensions; using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Media; +using WatchIt.Common.Model.Movies; +using WatchIt.Common.Model.Persons; +using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Series; using WatchIt.Database; using WatchIt.Database.Model.Account; +using WatchIt.Database.Model.Media; +using WatchIt.Database.Model.Rating; using WatchIt.WebAPI.Services.Controllers.Common; using WatchIt.WebAPI.Services.Utility.Tokens; using WatchIt.WebAPI.Services.Utility.Tokens.Exceptions; using WatchIt.WebAPI.Services.Utility.User; +using Account = WatchIt.Database.Model.Account.Account; using AccountProfilePicture = WatchIt.Common.Model.Accounts.AccountProfilePicture; +using Person = WatchIt.Database.Model.Person.Person; namespace WatchIt.WebAPI.Services.Controllers.Accounts; @@ -24,20 +33,17 @@ public class AccountsControllerService( { #region PUBLIC METHODS + #region Basic + public async Task Register(RegisterRequest data) { - string leftSalt = StringExtensions.CreateRandom(20); - string rightSalt = StringExtensions.CreateRandom(20); - byte[] hash = ComputeHash(data.Password, leftSalt, rightSalt); - Account account = new Account { Username = data.Username, Email = data.Email, - Password = hash, - LeftSalt = leftSalt, - RightSalt = rightSalt, }; + + SetPassword(account, data.Password); await database.Accounts.AddAsync(account); await database.SaveChangesAsync(); @@ -61,6 +67,9 @@ public class AccountsControllerService( RefreshToken = await refreshTokenTask, }; + account.LastActive = DateTime.UtcNow; + await database.SaveChangesAsync(); + logger.LogInformation($"Account with ID {account.Id} was authenticated"); return RequestResult.Ok(response); } @@ -90,6 +99,9 @@ public class AccountsControllerService( string accessToken = await tokensService.CreateAccessTokenAsync(token.Account); + token.Account.LastActive = DateTime.UtcNow; + await database.SaveChangesAsync(); + logger.LogInformation($"Account with ID {token.AccountId} was authenticated by token refreshing"); return RequestResult.Ok(new AuthenticateResponse { @@ -111,6 +123,10 @@ public class AccountsControllerService( return RequestResult.NoContent(); } + #endregion + + #region Profile picture + public async Task GetAccountProfilePicture(long id) { Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); @@ -128,6 +144,224 @@ public class AccountsControllerService( AccountProfilePictureResponse picture = new AccountProfilePictureResponse(account.ProfilePicture); return RequestResult.Ok(picture); } + + public async Task PutAccountProfilePicture(AccountProfilePictureRequest data) + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + Database.Model.Account.AccountProfilePicture? picture = account.ProfilePicture; + + if (picture is null) + { + picture = data.CreateMediaPosterImage(); + await database.AccountProfilePictures.AddAsync(picture); + await database.SaveChangesAsync(); + + account.ProfilePictureId = picture.Id; + } + else + { + data.UpdateMediaPosterImage(picture); + } + + await database.SaveChangesAsync(); + + AccountProfilePictureResponse returnData = new AccountProfilePictureResponse(picture); + return RequestResult.Ok(returnData); + } + + public async Task DeleteAccountProfilePicture() + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + Database.Model.Account.AccountProfilePicture? picture = account.ProfilePicture; + + if (picture is not null) + { + account.ProfilePictureId = null; + await database.SaveChangesAsync(); + + database.AccountProfilePictures.Attach(picture); + database.AccountProfilePictures.Remove(picture); + await database.SaveChangesAsync(); + } + + return RequestResult.NoContent(); + } + + #endregion + + #region Profile background + + public async Task GetAccountProfileBackground(long id) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); + if (account is null) + { + return RequestResult.BadRequest() + .AddValidationError("id", "Account with this id does not exists"); + } + + if (account.BackgroundPicture is null) + { + return RequestResult.NotFound(); + } + + PhotoResponse response = new PhotoResponse(account.BackgroundPicture); + return RequestResult.Ok(response); + } + + public async Task PutAccountProfileBackground(AccountProfileBackgroundRequest data) + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + + account.BackgroundPictureId = data.Id; + + await database.SaveChangesAsync(); + + PhotoResponse returnData = new PhotoResponse(account.BackgroundPicture!); + return RequestResult.Ok(returnData); + } + + public async Task DeleteAccountProfileBackground() + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + + if (account.BackgroundPicture is not null) + { + account.BackgroundPictureId = null; + await database.SaveChangesAsync(); + } + + return RequestResult.NoContent(); + } + + #endregion + + #region Info + + public async Task GetAccounts(AccountQueryParameters query) + { + IEnumerable accounts = await database.Accounts.ToListAsync(); + IEnumerable accountsData = accounts.Select(x => new AccountResponse(x)); + accountsData = query.PrepareData(accountsData); + return RequestResult.Ok(accountsData); + } + + public async Task GetAccount(long id) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); + if (account is null) + { + return RequestResult.NotFound(); + } + + AccountResponse profileInfoResponse = new AccountResponse(account); + return RequestResult.Ok(profileInfoResponse); + } + + public async Task PutAccountProfileInfo(AccountProfileInfoRequest data) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == userService.GetUserId()); + if (account is null) + { + return RequestResult.NotFound(); + } + + data.UpdateAccount(account); + await database.SaveChangesAsync(); + + return RequestResult.Ok(); + } + + public async Task PatchAccountUsername(AccountUsernameRequest data) + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + + if (!ComputeHash(data.Password, account.LeftSalt, account.RightSalt).SequenceEqual(account.Password)) + { + return RequestResult.Unauthorized(); + } + + data.UpdateAccount(account); + await database.SaveChangesAsync(); + + return RequestResult.Ok(); + } + + public async Task PatchAccountEmail(AccountEmailRequest data) + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + + if (!ComputeHash(data.Password, account.LeftSalt, account.RightSalt).SequenceEqual(account.Password)) + { + return RequestResult.Unauthorized(); + } + + data.UpdateAccount(account); + await database.SaveChangesAsync(); + + return RequestResult.Ok(); + } + + public async Task PatchAccountPassword(AccountPasswordRequest data) + { + Account account = await database.Accounts.FirstAsync(x => x.Id == userService.GetUserId()); + + if (!ComputeHash(data.OldPassword, account.LeftSalt, account.RightSalt).SequenceEqual(account.Password)) + { + return RequestResult.Unauthorized(); + } + + SetPassword(account, data.NewPassword); + await database.SaveChangesAsync(); + + return RequestResult.Ok(); + } + + #endregion + + public async Task GetAccountRatedMovies(long id, MovieRatedQueryParameters query) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); + if (account is null) + { + return RequestResult.NotFound(); + } + + IEnumerable response = account.RatingMedia.Join(database.MediaMovies, x => x.MediaId, x => x.Id, (x, y) => new MovieRatedResponse(y, x)); + response = query.PrepareData(response); + return RequestResult.Ok(response); + } + + public async Task GetAccountRatedSeries(long id, SeriesRatedQueryParameters query) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); + if (account is null) + { + return RequestResult.NotFound(); + } + + IEnumerable response = account.RatingMedia.Join(database.MediaSeries, x => x.MediaId, x => x.Id, (x, y) => new SeriesRatedResponse(y, x)); + response = query.PrepareData(response); + return RequestResult.Ok(response); + } + + public async Task GetAccountRatedPersons(long id, PersonRatedQueryParameters query) + { + Account? account = await database.Accounts.FirstOrDefaultAsync(x => x.Id == id); + if (account is null) + { + return RequestResult.NotFound(); + } + + IEnumerable actorRolesRatings = account.RatingPersonActorRole; + IEnumerable creatorRolesRatings = account.RatingPersonCreatorRole; + IEnumerable persons = actorRolesRatings.Select(x => x.PersonActorRole.Person) + .Union(creatorRolesRatings.Select(x => x.PersonCreatorRole.Person)); + + IEnumerable response = persons.Select(x => new PersonRatedResponse(x, actorRolesRatings.Where(y => y.PersonActorRole.Person.Id == x.Id), creatorRolesRatings.Where(y => y.PersonCreatorRole.Person.Id == x.Id))); + response = query.PrepareData(response); + return RequestResult.Ok(response); + } #endregion @@ -137,5 +371,16 @@ public class AccountsControllerService( protected byte[] ComputeHash(string password, string leftSalt, string rightSalt) => SHA512.HashData(Encoding.UTF8.GetBytes($"{leftSalt}{password}{rightSalt}")); + private void SetPassword(Account account, string password) + { + string leftSalt = StringExtensions.CreateRandom(20); + string rightSalt = StringExtensions.CreateRandom(20); + byte[] hash = ComputeHash(password, leftSalt, rightSalt); + + account.Password = hash; + account.LeftSalt = leftSalt; + account.RightSalt = rightSalt; + } + #endregion } \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs index 4d7974d..bb03dc5 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Accounts/IAccountsControllerService.cs @@ -1,4 +1,8 @@ using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Media; +using WatchIt.Common.Model.Movies; +using WatchIt.Common.Model.Persons; +using WatchIt.Common.Model.Series; using WatchIt.WebAPI.Services.Controllers.Common; namespace WatchIt.WebAPI.Services.Controllers.Accounts; @@ -10,4 +14,18 @@ public interface IAccountsControllerService Task AuthenticateRefresh(); Task Logout(); Task GetAccountProfilePicture(long id); + Task PutAccountProfilePicture(AccountProfilePictureRequest data); + Task DeleteAccountProfilePicture(); + Task GetAccountProfileBackground(long id); + Task PutAccountProfileBackground(AccountProfileBackgroundRequest data); + Task DeleteAccountProfileBackground(); + Task GetAccounts(AccountQueryParameters query); + Task GetAccount(long id); + Task PutAccountProfileInfo(AccountProfileInfoRequest data); + Task PatchAccountUsername(AccountUsernameRequest data); + Task PatchAccountEmail(AccountEmailRequest data); + Task PatchAccountPassword(AccountPasswordRequest data); + Task GetAccountRatedMovies(long id, MovieRatedQueryParameters query); + Task GetAccountRatedSeries(long id, SeriesRatedQueryParameters query); + Task GetAccountRatedPersons(long id, PersonRatedQueryParameters query); } \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs index 46bde20..ac92c5f 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Media/MediaControllerService.cs @@ -118,7 +118,9 @@ public class MediaControllerService(DatabaseContext database, IUserService userS return RequestResult.NotFound(); } - RatingResponse ratingResponse = RatingResponse.Create(item.RatingMedia); + RatingResponse ratingResponse = RatingResponseBuilder.Initialize() + .Add(item.RatingMedia, x => x.Rating) + .Build(); return RequestResult.Ok(ratingResponse); } diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Persons/PersonsControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Persons/PersonsControllerService.cs index 3a80110..a8857aa 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Persons/PersonsControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Persons/PersonsControllerService.cs @@ -335,7 +335,10 @@ public class PersonsControllerService : IPersonsControllerService return RequestResult.NotFound(); } - RatingResponse ratingResponse = RatingResponse.Create(item.PersonActorRoles, item.PersonCreatorRoles); + RatingResponse ratingResponse = RatingResponseBuilder.Initialize() + .Add(item.PersonActorRoles.SelectMany(x => x.RatingPersonActorRole), x => x.Rating) + .Add(item.PersonCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole), x => x.Rating) + .Build(); return RequestResult.Ok(ratingResponse); } @@ -347,10 +350,11 @@ public class PersonsControllerService : IPersonsControllerService { return RequestResult.NotFound(); } - - IEnumerable actorRoleRatings = item.PersonActorRoles.SelectMany(x => x.RatingPersonActorRole).Where(x => x.AccountId == userId); - IEnumerable creatorRoleRatings = item.PersonCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole).Where(x => x.AccountId == userId); - RatingResponse ratingResponse = RatingResponse.Create(actorRoleRatings, creatorRoleRatings); + + RatingResponse ratingResponse = RatingResponseBuilder.Initialize() + .Add(item.PersonActorRoles.SelectMany(x => x.RatingPersonActorRole).Where(x => x.AccountId == userId), x => x.Rating) + .Add(item.PersonCreatorRoles.SelectMany(x => x.RatingPersonCreatorRole).Where(x => x.AccountId == userId), x => x.Rating) + .Build(); return RequestResult.Ok(ratingResponse); } diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Roles/RolesControllerService.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Roles/RolesControllerService.cs index d9d88c2..b86b622 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Roles/RolesControllerService.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Controllers/WatchIt.WebAPI.Services.Controllers.Roles/RolesControllerService.cs @@ -97,7 +97,9 @@ public class RolesControllerService : IRolesControllerService return RequestResult.NotFound(); } - RatingResponse ratingResponse = RatingResponse.Create(item.RatingPersonActorRole); + RatingResponse ratingResponse = RatingResponseBuilder.Initialize() + .Add(item.RatingPersonActorRole, x => x.Rating) + .Build(); return RequestResult.Ok(ratingResponse); } @@ -281,7 +283,9 @@ public class RolesControllerService : IRolesControllerService return RequestResult.NotFound(); } - RatingResponse ratingResponse = RatingResponse.Create(item.RatingPersonCreatorRole); + RatingResponse ratingResponse = RatingResponseBuilder.Initialize() + .Add(item.RatingPersonCreatorRole, x => x.Rating) + .Build(); return RequestResult.Ok(ratingResponse); } diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Utility/WatchIt.WebAPI.Services.Utility.User/UserValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Utility/WatchIt.WebAPI.Services.Utility.User/UserValidator.cs index b3ae31d..3dc0c41 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Utility/WatchIt.WebAPI.Services.Utility.User/UserValidator.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Services/WatchIt.WebAPI.Services.Utility/WatchIt.WebAPI.Services.Utility.User/UserValidator.cs @@ -1,4 +1,5 @@ -using System.Security.Claims; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; using WatchIt.Database; namespace WatchIt.WebAPI.Services.Utility.User; @@ -53,5 +54,17 @@ public class UserValidator return this; } + public UserValidator MustHaveId(long id) + { + Claim adminClaim = _claimsPrincipal.FindFirst(x => x.Type == JwtRegisteredClaimNames.Sub)!; + if (adminClaim.Value == id.ToString()) + { + IsValid = false; + _validationErrors.Add("User have wrong id"); + } + + return this; + } + #endregion } \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountEmailRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountEmailRequestValidator.cs new file mode 100644 index 0000000..6bc7e63 --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountEmailRequestValidator.cs @@ -0,0 +1,15 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; +using WatchIt.Database; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountEmailRequestValidator : AbstractValidator +{ + public AccountEmailRequestValidator(DatabaseContext database) + { + RuleFor(x => x.NewEmail).EmailAddress() + .CannotBeIn(database.Accounts, x => x.Email) + .WithMessage("Email was already used"); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountPasswordRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountPasswordRequestValidator.cs new file mode 100644 index 0000000..ffa2096 --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountPasswordRequestValidator.cs @@ -0,0 +1,17 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; +using WatchIt.Database; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountPasswordRequestValidator : AbstractValidator +{ + public AccountPasswordRequestValidator(DatabaseContext database) + { + RuleFor(x => x.NewPassword).MinimumLength(8) + .Must(x => x.Any(char.IsUpper)).WithMessage("Password must contain at least one uppercase letter.") + .Must(x => x.Any(char.IsLower)).WithMessage("Password must contain at least one lowercase letter.") + .Must(x => x.Any(char.IsDigit)).WithMessage("Password must contain at least one digit.") + .Equal(x => x.NewPasswordConfirmation); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileBackgroundRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileBackgroundRequestValidator.cs new file mode 100644 index 0000000..205be53 --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileBackgroundRequestValidator.cs @@ -0,0 +1,14 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; +using WatchIt.Database; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountProfileBackgroundRequestValidator : AbstractValidator +{ + public AccountProfileBackgroundRequestValidator(DatabaseContext database) + { + RuleFor(x => x.Id).MustBeIn(database.MediaPhotoImages.Where(x => x.MediaPhotoImageBackground != null), x => x.Id) + .WithMessage("Image has to be background"); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileInfoRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileInfoRequestValidator.cs new file mode 100644 index 0000000..aa20074 --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfileInfoRequestValidator.cs @@ -0,0 +1,17 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; +using WatchIt.Database; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountProfileInfoRequestValidator : AbstractValidator +{ + public AccountProfileInfoRequestValidator(DatabaseContext database) + { + RuleFor(x => x.Description).MaximumLength(1000); + When(x => x.GenderId.HasValue, () => + { + RuleFor(x => x.GenderId!.Value).MustBeIn(database.Genders.Select(x => x.Id)); + }); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfilePictureRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfilePictureRequestValidator.cs new file mode 100644 index 0000000..873766c --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountProfilePictureRequestValidator.cs @@ -0,0 +1,13 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountProfilePictureRequestValidator : AbstractValidator +{ + public AccountProfilePictureRequestValidator() + { + RuleFor(x => x.Image).NotEmpty(); + RuleFor(x => x.MimeType).Matches(@"\w+/.+").WithMessage("Incorrect mimetype"); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountUsernameRequestValidator.cs b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountUsernameRequestValidator.cs new file mode 100644 index 0000000..6c0ad30 --- /dev/null +++ b/WatchIt.WebAPI/WatchIt.WebAPI.Validators/Accounts/AccountUsernameRequestValidator.cs @@ -0,0 +1,16 @@ +using FluentValidation; +using WatchIt.Common.Model.Accounts; +using WatchIt.Database; + +namespace WatchIt.WebAPI.Validators.Accounts; + +public class AccountUsernameRequestValidator : AbstractValidator +{ + public AccountUsernameRequestValidator(DatabaseContext database) + { + RuleFor(x => x.NewUsername).MinimumLength(5) + .MaximumLength(50) + .CannotBeIn(database.Accounts, x => x.Username) + .WithMessage("Username is already used"); + } +} \ No newline at end of file diff --git a/WatchIt.WebAPI/WatchIt.WebAPI/Program.cs b/WatchIt.WebAPI/WatchIt.WebAPI/Program.cs index d6c6797..581c7c6 100644 --- a/WatchIt.WebAPI/WatchIt.WebAPI/Program.cs +++ b/WatchIt.WebAPI/WatchIt.WebAPI/Program.cs @@ -46,6 +46,7 @@ public static class Program while (!dbContext.Database.CanConnect()) { + app.Logger.LogInformation("Waiting for database..."); Thread.Sleep(1000); } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/AuthenticationService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/AuthenticationService.cs similarity index 85% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/AuthenticationService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/AuthenticationService.cs index efe799c..9f57109 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/AuthenticationService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/AuthenticationService.cs @@ -1,10 +1,10 @@ using System.IdentityModel.Tokens.Jwt; using System.Net.Http.Headers; using Microsoft.AspNetCore.Components.Authorization; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Accounts; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Tokens; -namespace WatchIt.Website.Services.Utility.Authentication; +namespace WatchIt.Website.Services.Authentication; public class AuthenticationService : IAuthenticationService { @@ -13,7 +13,7 @@ public class AuthenticationService : IAuthenticationService private readonly AuthenticationStateProvider _authenticationStateProvider; private readonly HttpClient _httpClient; private readonly ITokensService _tokensService; - private readonly IAccountsWebAPIService _accountsWebAPIService; + private readonly IAccountsClientService _accountsClientService; #endregion @@ -21,12 +21,12 @@ public class AuthenticationService : IAuthenticationService #region CONSTRUCTORS - public AuthenticationService(AuthenticationStateProvider authenticationStateProvider, HttpClient httpClient, ITokensService tokensService, IAccountsWebAPIService accountsWebAPIService) + public AuthenticationService(AuthenticationStateProvider authenticationStateProvider, HttpClient httpClient, ITokensService tokensService, IAccountsClientService accountsClientService) { _authenticationStateProvider = authenticationStateProvider; _httpClient = httpClient; _tokensService = tokensService; - _accountsWebAPIService = accountsWebAPIService; + _accountsClientService = accountsClientService; } #endregion @@ -65,7 +65,7 @@ public class AuthenticationService : IAuthenticationService if (refreshToken is not null) { _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("refresh", refreshToken.Replace("\"", "")); - await _accountsWebAPIService.Logout(); + await _accountsClientService.Logout(); _httpClient.DefaultRequestHeaders.Authorization = null; } } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/IAuthenticationService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/IAuthenticationService.cs similarity index 70% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/IAuthenticationService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/IAuthenticationService.cs index 68ef29c..99a4ac9 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/IAuthenticationService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/IAuthenticationService.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Authentication; +namespace WatchIt.Website.Services.Authentication; public interface IAuthenticationService { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/JWTAuthenticationStateProvider.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/JWTAuthenticationStateProvider.cs similarity index 94% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/JWTAuthenticationStateProvider.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/JWTAuthenticationStateProvider.cs index 3646136..b86ccbe 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/JWTAuthenticationStateProvider.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/JWTAuthenticationStateProvider.cs @@ -4,10 +4,10 @@ using System.Text.Json; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.Extensions.Logging; using WatchIt.Common.Model.Accounts; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Accounts; +using WatchIt.Website.Services.Tokens; +using WatchIt.Website.Services.Client.Accounts; -namespace WatchIt.Website.Services.Utility.Authentication; +namespace WatchIt.Website.Services.Authentication; public class JWTAuthenticationStateProvider : AuthenticationStateProvider { @@ -18,7 +18,7 @@ public class JWTAuthenticationStateProvider : AuthenticationStateProvider private readonly ILogger _logger; private readonly ITokensService _tokensService; - private readonly IAccountsWebAPIService _accountsService; + private readonly IAccountsClientService _accountsService; #endregion @@ -26,7 +26,7 @@ public class JWTAuthenticationStateProvider : AuthenticationStateProvider #region CONSTRUCTORS - public JWTAuthenticationStateProvider(HttpClient httpClient, ILogger logger, ITokensService tokensService, IAccountsWebAPIService accountsService) + public JWTAuthenticationStateProvider(HttpClient httpClient, ILogger logger, ITokensService tokensService, IAccountsClientService accountsService) { _httpClient = httpClient; diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/User.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/User.cs similarity index 80% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/User.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/User.cs index 247e171..e4a7042 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/User.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/User.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Authentication; +namespace WatchIt.Website.Services.Authentication; public class User { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/WatchIt.Website.Services.Authentication.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/WatchIt.Website.Services.Authentication.csproj new file mode 100644 index 0000000..8e4ca55 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Authentication/WatchIt.Website.Services.Authentication.csproj @@ -0,0 +1,24 @@ + + + + net8.0 + enable + enable + + + + + ..\..\..\..\..\..\..\Program Files\dotnet\shared\Microsoft.AspNetCore.App\8.0.10\Microsoft.AspNetCore.Components.Authorization.dll + + + + + + + + + + + + + diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs new file mode 100644 index 0000000..df8649f --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/AccountsClientService.cs @@ -0,0 +1,288 @@ +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Movies; +using WatchIt.Common.Model.Persons; +using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Series; +using WatchIt.Common.Services.HttpClient; +using WatchIt.Website.Services.Configuration; +using WatchIt.Website.Services.Tokens; + +namespace WatchIt.Website.Services.Client.Accounts; + +public class AccountsClientService(IHttpClientService httpClientService, IConfigurationService configurationService, ITokensService tokensService) : BaseClientService(configurationService), IAccountsClientService +{ + #region PUBLIC METHODS + + public async Task Register(RegisterRequest data, Action? createdAction = null, Action>? badRequestAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.Register); + HttpRequest request = new HttpRequest(HttpMethodType.Post, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(createdAction) + .RegisterActionFor400BadRequest(badRequestAction) + .ExecuteAction(); + } + + public async Task Authenticate(AuthenticateRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.Authenticate); + HttpRequest request = new HttpRequest(HttpMethodType.Post, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task AuthenticateRefresh(Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.AuthenticateRefresh); + string? token = await tokensService.GetRefreshToken(); + + HttpRequest request = new HttpRequest(HttpMethodType.Post, url); + request.Headers.Add("Authorization", $"Bearer {token}"); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .RegisterActionFor403Forbidden(forbiddenAction) + .ExecuteAction(); + } + + public async Task Logout(Action? successAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.Logout); + string? token = await tokensService.GetRefreshToken(); + + HttpRequest request = new HttpRequest(HttpMethodType.Delete, url); + request.Headers.Add("Authorization", $"Bearer {token}"); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .ExecuteAction(); + } + + public async Task GetAccountProfilePicture(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountProfilePicture, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + public async Task PutAccountProfilePicture(AccountProfilePictureRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PutAccountProfilePicture); + + HttpRequest request = new HttpRequest(HttpMethodType.Put, url) + { + Body = data + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task DeleteAccountProfilePicture(Action? successAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.DeleteAccountProfilePicture); + + HttpRequest request = new HttpRequest(HttpMethodType.Delete, url); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task GetAccountProfileBackground(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountProfileBackground, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + public async Task PutAccountProfileBackground(AccountProfileBackgroundRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PutAccountProfileBackground); + + HttpRequest request = new HttpRequest(HttpMethodType.Put, url) + { + Body = data + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task DeleteAccountProfileBackground(Action? successAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.DeleteAccountProfileBackground); + + HttpRequest request = new HttpRequest(HttpMethodType.Delete, url); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task GetAccounts(AccountQueryParameters query, Action>? successAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccounts); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url) + { + Query = query + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .ExecuteAction(); + } + + public async Task GetAccount(long id, Action? successAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccount, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url); + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + public async Task PutAccountProfileInfo(AccountProfileInfoRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PutAccountProfileInfo); + HttpRequest request = new HttpRequest(HttpMethodType.Put, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task PatchAccountUsername(AccountUsernameRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PatchAccountUsername); + HttpRequest request = new HttpRequest(HttpMethodType.Patch, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task PatchAccountEmail(AccountEmailRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PatchAccountEmail); + HttpRequest request = new HttpRequest(HttpMethodType.Patch, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task PatchAccountPassword(AccountPasswordRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.PatchAccountPassword); + HttpRequest request = new HttpRequest(HttpMethodType.Patch, url) + { + Body = data, + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor400BadRequest(badRequestAction) + .RegisterActionFor401Unauthorized(unauthorizedAction) + .ExecuteAction(); + } + + public async Task GetAccountRatedMovies(long id, MovieRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountRatedMovies, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url) + { + Query = query + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + public async Task GetAccountRatedSeries(long id, SeriesRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountRatedSeries, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url) + { + Query = query + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + public async Task GetAccountRatedPersons(long id, PersonRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null) + { + string url = GetUrl(EndpointsConfiguration.Accounts.GetAccountRatedPersons, id); + HttpRequest request = new HttpRequest(HttpMethodType.Get, url) + { + Query = query + }; + + HttpResponse response = await httpClientService.SendRequestAsync(request); + response.RegisterActionFor2XXSuccess(successAction) + .RegisterActionFor404NotFound(notFoundAction) + .ExecuteAction(); + } + + #endregion + + + + #region PRIVATE METHODS + + protected override string GetServiceBase() => EndpointsConfiguration.Accounts.Base; + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs new file mode 100644 index 0000000..09543c6 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Accounts/IAccountsClientService.cs @@ -0,0 +1,30 @@ +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Movies; +using WatchIt.Common.Model.Persons; +using WatchIt.Common.Model.Photos; +using WatchIt.Common.Model.Series; + +namespace WatchIt.Website.Services.Client.Accounts; + +public interface IAccountsClientService +{ + Task Register(RegisterRequest data, Action? createdAction = null, Action>? badRequestAction = null); + Task Authenticate(AuthenticateRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task AuthenticateRefresh(Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null); + Task Logout(Action? successAction = null); + Task GetAccountProfilePicture(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null); + Task PutAccountProfilePicture(AccountProfilePictureRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task DeleteAccountProfilePicture(Action? successAction = null, Action? unauthorizedAction = null); + Task GetAccountProfileBackground(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null); + Task PutAccountProfileBackground(AccountProfileBackgroundRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task DeleteAccountProfileBackground(Action? successAction = null, Action? unauthorizedAction = null); + Task GetAccounts(AccountQueryParameters query, Action>? successAction = null); + Task GetAccount(long id, Action? successAction = null, Action? notFoundAction = null); + Task PutAccountProfileInfo(AccountProfileInfoRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task PatchAccountUsername(AccountUsernameRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task PatchAccountEmail(AccountEmailRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task PatchAccountPassword(AccountPasswordRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); + Task GetAccountRatedMovies(long id, MovieRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null); + Task GetAccountRatedSeries(long id, SeriesRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null); + Task GetAccountRatedPersons(long id, PersonRatedQueryParameters query, Action>? successAction = null, Action? notFoundAction = null); +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/AuthorizationType.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/AuthorizationType.cs similarity index 52% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/AuthorizationType.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/AuthorizationType.cs index b98bd71..687d7c4 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/AuthorizationType.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/AuthorizationType.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.WebAPI.Common; +namespace WatchIt.Website.Services.Client; public enum AuthorizationType { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/BaseWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/BaseClientService.cs similarity index 71% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/BaseWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/BaseClientService.cs index aab7ea8..fd9a9a3 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/BaseWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/BaseClientService.cs @@ -1,10 +1,9 @@ -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.Utility.Configuration.Model; -using WatchIt.Website.Services.Utility.Tokens; +using WatchIt.Website.Services.Configuration; +using WatchIt.Website.Services.Configuration.Model; -namespace WatchIt.Website.Services.WebAPI.Common; +namespace WatchIt.Website.Services.Client; -public abstract class BaseWebAPIService +public abstract class BaseClientService { #region SERVICES @@ -24,7 +23,7 @@ public abstract class BaseWebAPIService #region CONSTRUCTORS - protected BaseWebAPIService(IConfigurationService configurationService) + protected BaseClientService(IConfigurationService configurationService) { _configurationService = configurationService; } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/GendersWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/GendersClientService.cs similarity index 91% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/GendersWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/GendersClientService.cs index 1976795..6221118 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/GendersWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/GendersClientService.cs @@ -1,11 +1,10 @@ using WatchIt.Common.Model.Genders; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Genders; +namespace WatchIt.Website.Services.Client.Genders; -public class GendersWebAPIService : BaseWebAPIService, IGendersWebAPIService +public class GendersClientService : BaseClientService, IGendersClientService { #region SERVICES @@ -18,7 +17,7 @@ public class GendersWebAPIService : BaseWebAPIService, IGendersWebAPIService #region CONSTRUCTORS - public GendersWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public GendersClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; _configurationService = configurationService; diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/IGendersWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/IGendersClientService.cs similarity index 87% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/IGendersWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/IGendersClientService.cs index 393b0fe..7e32d3a 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/IGendersWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Genders/IGendersClientService.cs @@ -1,8 +1,8 @@ using WatchIt.Common.Model.Genders; -namespace WatchIt.Website.Services.WebAPI.Genders; +namespace WatchIt.Website.Services.Client.Genders; -public interface IGendersWebAPIService +public interface IGendersClientService { Task GetAllGenders(GenderQueryParameters? query = null, Action>? successAction = null); Task GetGender(long id, Action? successAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/IMediaClientService.cs similarity index 97% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/IMediaClientService.cs index 7f80fa0..bdc3465 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/IMediaWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/IMediaClientService.cs @@ -4,9 +4,9 @@ using WatchIt.Common.Model.Photos; using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; -namespace WatchIt.Website.Services.WebAPI.Media; +namespace WatchIt.Website.Services.Client.Media; -public interface IMediaWebAPIService +public interface IMediaClientService { Task GetAllMedia(MediaQueryParameters? query = null, Action>? successAction = null); Task GetMedia(long mediaId, Action? successAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/MediaClientService.cs similarity index 97% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/MediaClientService.cs index 4fecf3b..d907dfb 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/MediaWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Media/MediaClientService.cs @@ -4,13 +4,11 @@ using WatchIt.Common.Model.Photos; using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.Utility.Configuration.Model; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Media; +namespace WatchIt.Website.Services.Client.Media; -public class MediaWebAPIService : BaseWebAPIService, IMediaWebAPIService +public class MediaClientService : BaseClientService, IMediaClientService { #region FIELDS @@ -22,7 +20,7 @@ public class MediaWebAPIService : BaseWebAPIService, IMediaWebAPIService #region CONSTRUCTORS - public MediaWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public MediaClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/IMoviesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/IMoviesClientService.cs similarity index 91% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/IMoviesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/IMoviesClientService.cs index 1bbe0e7..2188efe 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/IMoviesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/IMoviesClientService.cs @@ -1,8 +1,8 @@ using WatchIt.Common.Model.Movies; -namespace WatchIt.Website.Services.WebAPI.Movies; +namespace WatchIt.Website.Services.Client.Movies; -public interface IMoviesWebAPIService +public interface IMoviesClientService { Task GetAllMovies(MovieQueryParameters? query = null, Action>? successAction = null); Task PostMovie(MovieRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/MoviesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/MoviesClientService.cs similarity index 94% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/MoviesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/MoviesClientService.cs index c8980bf..8ccc46c 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/MoviesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Movies/MoviesClientService.cs @@ -3,12 +3,11 @@ using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Primitives; using WatchIt.Common.Model.Movies; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Movies; +namespace WatchIt.Website.Services.Client.Movies; -public class MoviesWebAPIService : BaseWebAPIService, IMoviesWebAPIService +public class MoviesClientService : BaseClientService, IMoviesClientService { #region SERVICES @@ -21,7 +20,7 @@ public class MoviesWebAPIService : BaseWebAPIService, IMoviesWebAPIService #region CONSTRUCTORS - public MoviesWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public MoviesClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; _configurationService = configurationService; diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/IPersonsWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/IPersonsClientService.cs similarity index 96% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/IPersonsWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/IPersonsClientService.cs index 071ed25..4e564e9 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/IPersonsWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/IPersonsClientService.cs @@ -2,9 +2,9 @@ using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; -namespace WatchIt.Website.Services.WebAPI.Persons; +namespace WatchIt.Website.Services.Client.Persons; -public interface IPersonsWebAPIService +public interface IPersonsClientService { Task GetAllPersons(PersonQueryParameters? query = null, Action>? successAction = null); Task GetPerson(long id, Action? successAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/PersonsWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/PersonsClientService.cs similarity index 97% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/PersonsWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/PersonsClientService.cs index a38a6f0..d0823eb 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/PersonsWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Persons/PersonsClientService.cs @@ -5,12 +5,11 @@ using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Persons; +namespace WatchIt.Website.Services.Client.Persons; -public class PersonsWebAPIService : BaseWebAPIService, IPersonsWebAPIService +public class PersonsClientService : BaseClientService, IPersonsClientService { #region SERVICES @@ -23,7 +22,7 @@ public class PersonsWebAPIService : BaseWebAPIService, IPersonsWebAPIService #region CONSTRUCTORS - public PersonsWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public PersonsClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; _configurationService = configurationService; diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/IPhotosWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/IPhotosClientService.cs similarity index 89% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/IPhotosWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/IPhotosClientService.cs index 560574b..4ed2b08 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/IPhotosWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/IPhotosClientService.cs @@ -1,8 +1,8 @@ using WatchIt.Common.Model.Photos; -namespace WatchIt.Website.Services.WebAPI.Photos; +namespace WatchIt.Website.Services.Client.Photos; -public interface IPhotosWebAPIService +public interface IPhotosClientService { Task GetPhotoRandomBackground(Action? successAction = null, Action? notFoundAction = null); Task DeletePhoto(Guid id, Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/PhotosWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/PhotosClientService.cs similarity index 92% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/PhotosWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/PhotosClientService.cs index 3ca5a1d..fb9f786 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/PhotosWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Photos/PhotosClientService.cs @@ -1,11 +1,10 @@ using WatchIt.Common.Model.Photos; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Photos; +namespace WatchIt.Website.Services.Client.Photos; -public class PhotosWebAPIService : BaseWebAPIService, IPhotosWebAPIService +public class PhotosClientService : BaseClientService, IPhotosClientService { #region FIELDS @@ -17,7 +16,7 @@ public class PhotosWebAPIService : BaseWebAPIService, IPhotosWebAPIService #region CONSTRUCTORS - public PhotosWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public PhotosClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/IRolesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/IRolesClientService.cs similarity index 97% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/IRolesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/IRolesClientService.cs index b270d98..885fcf2 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/IRolesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/IRolesClientService.cs @@ -1,9 +1,9 @@ using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; -namespace WatchIt.Website.Services.WebAPI.Roles; +namespace WatchIt.Website.Services.Client.Roles; -public interface IRolesWebAPIService +public interface IRolesClientService { Task GetActorRole(Guid id, Action? successAction = null, Action? notFoundAction = null); Task PutActorRole(Guid id, ActorRoleUniversalRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/RolesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/RolesClientService.cs similarity index 98% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/RolesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/RolesClientService.cs index 09b0418..29401f2 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/RolesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Roles/RolesClientService.cs @@ -1,12 +1,11 @@ using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Roles; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Roles; +namespace WatchIt.Website.Services.Client.Roles; -public class RolesWebAPIService : BaseWebAPIService, IRolesWebAPIService +public class RolesClientService : BaseClientService, IRolesClientService { #region SERVICES @@ -18,7 +17,7 @@ public class RolesWebAPIService : BaseWebAPIService, IRolesWebAPIService #region CONSTRUCTORS - public RolesWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public RolesClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; } diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/ISeriesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/ISeriesClientService.cs similarity index 91% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/ISeriesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/ISeriesClientService.cs index dfb2b4d..8a4dd44 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/ISeriesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/ISeriesClientService.cs @@ -1,8 +1,8 @@ using WatchIt.Common.Model.Series; -namespace WatchIt.Website.Services.WebAPI.Series; +namespace WatchIt.Website.Services.Client.Series; -public interface ISeriesWebAPIService +public interface ISeriesClientService { Task GetAllSeries(SeriesQueryParameters? query = null, Action>? successAction = null); Task GetSeries(long id, Action? successAction = null, Action? notFoundAction = null); diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/SeriesWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/SeriesClientService.cs similarity index 94% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/SeriesWebAPIService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/SeriesClientService.cs index 52f144b..5a3bc59 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/SeriesWebAPIService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/Series/SeriesClientService.cs @@ -1,12 +1,11 @@ using System.Text; using WatchIt.Common.Model.Series; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.WebAPI.Common; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.WebAPI.Series; +namespace WatchIt.Website.Services.Client.Series; -public class SeriesWebAPIService : BaseWebAPIService, ISeriesWebAPIService +public class SeriesClientService : BaseClientService, ISeriesClientService { #region SERVICES @@ -19,7 +18,7 @@ public class SeriesWebAPIService : BaseWebAPIService, ISeriesWebAPIService #region CONSTRUCTORS - public SeriesWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) + public SeriesClientService(IHttpClientService httpClientService, IConfigurationService configurationService) : base(configurationService) { _httpClientService = httpClientService; _configurationService = configurationService; diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/WatchIt.Website.Services.Client.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/WatchIt.Website.Services.Client.csproj new file mode 100644 index 0000000..97f494d --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Client/WatchIt.Website.Services.Client.csproj @@ -0,0 +1,16 @@ + + + + net8.0 + enable + enable + + + + + + + + + + diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/ConfigurationService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/ConfigurationService.cs similarity index 68% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/ConfigurationService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/ConfigurationService.cs index ea86d69..5848589 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/ConfigurationService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/ConfigurationService.cs @@ -1,7 +1,7 @@ using Microsoft.Extensions.Configuration; -using WatchIt.Website.Services.Utility.Configuration.Model; +using WatchIt.Website.Services.Configuration.Model; -namespace WatchIt.Website.Services.Utility.Configuration; +namespace WatchIt.Website.Services.Configuration; public class ConfigurationService(IConfiguration configuration) : IConfigurationService { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/IConfigurationService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/IConfigurationService.cs new file mode 100644 index 0000000..852ca0a --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/IConfigurationService.cs @@ -0,0 +1,8 @@ +using WatchIt.Website.Services.Configuration.Model; + +namespace WatchIt.Website.Services.Configuration; + +public interface IConfigurationService +{ + ConfigurationData Data { get; } +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs new file mode 100644 index 0000000..eae345a --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Accounts.cs @@ -0,0 +1,25 @@ +namespace WatchIt.Website.Services.Configuration.Model; + +public class Accounts +{ + public string Base { get; set; } + public string Register { get; set; } + public string Authenticate { get; set; } + public string AuthenticateRefresh { get; set; } + public string Logout { get; set; } + public string GetAccountProfilePicture { get; set; } + public string PutAccountProfilePicture { get; set; } + public string DeleteAccountProfilePicture { get; set; } + public string GetAccountProfileBackground { get; set; } + public string PutAccountProfileBackground { get; set; } + public string DeleteAccountProfileBackground { get; set; } + public string GetAccounts { get; set; } + public string GetAccount { get; set; } + public string PutAccountProfileInfo { get; set; } + public string PatchAccountUsername { get; set; } + public string PatchAccountEmail { get; set; } + public string PatchAccountPassword { get; set; } + public string GetAccountRatedMovies { get; set; } + public string GetAccountRatedSeries { get; set; } + public string GetAccountRatedPersons { get; set; } +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/ConfigurationData.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/ConfigurationData.cs similarity index 78% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/ConfigurationData.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/ConfigurationData.cs index 7709295..d8032f0 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/ConfigurationData.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/ConfigurationData.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class ConfigurationData { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Endpoints.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Endpoints.cs similarity index 86% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Endpoints.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Endpoints.cs index 386b6c1..979014c 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Endpoints.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Endpoints.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Endpoints { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genders.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genders.cs similarity index 78% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genders.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genders.cs index 58a8f53..93765b3 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genders.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genders.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Genders { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genres.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genres.cs similarity index 78% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genres.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genres.cs index 108e72b..59d41f4 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Genres.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Genres.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Genres { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/LogLevel.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/LogLevel.cs similarity index 63% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/LogLevel.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/LogLevel.cs index 601ee2d..dfb4f77 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/LogLevel.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/LogLevel.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class LogLevel { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Logging.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Logging.cs similarity index 50% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Logging.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Logging.cs index 25db637..608faab 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Logging.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Logging.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Logging { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Media.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Media.cs similarity index 93% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Media.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Media.cs index a7ae025..9aa7a09 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Media.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Media.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Media { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Movies.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Movies.cs similarity index 82% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Movies.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Movies.cs index 36ee8e2..abe1ff8 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Movies.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Movies.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Movies { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Persons.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Persons.cs similarity index 92% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Persons.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Persons.cs index 0bbc44e..2cc849d 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Persons.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Persons.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Persons { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Photos.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Photos.cs similarity index 81% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Photos.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Photos.cs index 46384b4..5fa02f1 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Photos.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Photos.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Photos { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Roles.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Roles.cs similarity index 94% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Roles.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Roles.cs index 6eec92e..8861284 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Roles.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Roles.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Roles { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Series.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Series.cs similarity index 83% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Series.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Series.cs index ec8dc63..a22e6ba 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Series.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Series.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Series { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/StorageKeys.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/StorageKeys.cs similarity index 63% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/StorageKeys.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/StorageKeys.cs index 456f4b0..60531b0 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/StorageKeys.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/StorageKeys.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class StorageKeys { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Style.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Style.cs similarity index 52% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Style.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Style.cs index 00abcbd..a6afadd 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Style.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/Model/Style.cs @@ -1,4 +1,4 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; +namespace WatchIt.Website.Services.Configuration.Model; public class Style { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/WatchIt.Website.Services.Utility.Configuration.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/WatchIt.Website.Services.Configuration.csproj similarity index 100% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/WatchIt.Website.Services.Utility.Configuration.csproj rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Configuration/WatchIt.Website.Services.Configuration.csproj diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/ITokensService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/ITokensService.cs similarity index 89% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/ITokensService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/ITokensService.cs index c0026a1..5c5d08a 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/ITokensService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/ITokensService.cs @@ -1,6 +1,6 @@ using WatchIt.Common.Model.Accounts; -namespace WatchIt.Website.Services.Utility.Tokens; +namespace WatchIt.Website.Services.Tokens; public interface ITokensService { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/TokensService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/TokensService.cs similarity index 96% rename from WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/TokensService.cs rename to WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/TokensService.cs index ffb35d5..fbbe843 100644 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/TokensService.cs +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/TokensService.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage; using Microsoft.Extensions.Logging; using WatchIt.Common.Model.Accounts; -using WatchIt.Website.Services.Utility.Configuration; +using WatchIt.Website.Services.Configuration; -namespace WatchIt.Website.Services.Utility.Tokens; +namespace WatchIt.Website.Services.Tokens; public class TokensService : ITokensService { diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/WatchIt.Website.Services.Tokens.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/WatchIt.Website.Services.Tokens.csproj new file mode 100644 index 0000000..c93f753 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Tokens/WatchIt.Website.Services.Tokens.csproj @@ -0,0 +1,14 @@ + + + + net8.0 + enable + enable + + + + + + + + diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/WatchIt.Website.Services.Utility.Authentication.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/WatchIt.Website.Services.Utility.Authentication.csproj deleted file mode 100644 index e669fe9..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Authentication/WatchIt.Website.Services.Utility.Authentication.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/IConfigurationService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/IConfigurationService.cs deleted file mode 100644 index 9a39607..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/IConfigurationService.cs +++ /dev/null @@ -1,8 +0,0 @@ -using WatchIt.Website.Services.Utility.Configuration.Model; - -namespace WatchIt.Website.Services.Utility.Configuration; - -public interface IConfigurationService -{ - ConfigurationData Data { get; } -} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Accounts.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Accounts.cs deleted file mode 100644 index ba1f2db..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Configuration/Model/Accounts.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace WatchIt.Website.Services.Utility.Configuration.Model; - -public class Accounts -{ - public string Base { get; set; } - public string Register { get; set; } - public string Authenticate { get; set; } - public string AuthenticateRefresh { get; set; } - public string Logout { get; set; } - public string GetProfilePicture { get; set; } -} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/WatchIt.Website.Services.Utility.Tokens.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/WatchIt.Website.Services.Utility.Tokens.csproj deleted file mode 100644 index 840c020..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.Utility/WatchIt.Website.Services.Utility.Tokens/WatchIt.Website.Services.Utility.Tokens.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net8.0 - enable - enable - WatchIt.Website.Services.Utility.Token - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/AccountsWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/AccountsWebAPIService.cs deleted file mode 100644 index f56757e..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/AccountsWebAPIService.cs +++ /dev/null @@ -1,92 +0,0 @@ -using WatchIt.Common.Model.Accounts; -using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.Utility.Configuration.Model; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Common; - -namespace WatchIt.Website.Services.WebAPI.Accounts; - -public class AccountsWebAPIService(IHttpClientService httpClientService, IConfigurationService configurationService, ITokensService tokensService) : BaseWebAPIService(configurationService), IAccountsWebAPIService -{ - #region PUBLIC METHODS - - public async Task Register(RegisterRequest data, Action? createdAction = null, Action>? badRequestAction = null) - { - string url = GetUrl(EndpointsConfiguration.Accounts.Register); - HttpRequest request = new HttpRequest(HttpMethodType.Post, url) - { - Body = data, - }; - - HttpResponse response = await httpClientService.SendRequestAsync(request); - response.RegisterActionFor2XXSuccess(createdAction) - .RegisterActionFor400BadRequest(badRequestAction) - .ExecuteAction(); - } - - public async Task Authenticate(AuthenticateRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null) - { - string url = GetUrl(EndpointsConfiguration.Accounts.Authenticate); - HttpRequest request = new HttpRequest(HttpMethodType.Post, url) - { - Body = data, - }; - - HttpResponse response = await httpClientService.SendRequestAsync(request); - response.RegisterActionFor2XXSuccess(successAction) - .RegisterActionFor400BadRequest(badRequestAction) - .RegisterActionFor401Unauthorized(unauthorizedAction) - .ExecuteAction(); - } - - public async Task AuthenticateRefresh(Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null) - { - string url = GetUrl(EndpointsConfiguration.Accounts.AuthenticateRefresh); - string? token = await tokensService.GetRefreshToken(); - - HttpRequest request = new HttpRequest(HttpMethodType.Post, url); - request.Headers.Add("Authorization", $"Bearer {token}"); - - HttpResponse response = await httpClientService.SendRequestAsync(request); - response.RegisterActionFor2XXSuccess(successAction) - .RegisterActionFor401Unauthorized(unauthorizedAction) - .RegisterActionFor403Forbidden(forbiddenAction) - .ExecuteAction(); - } - - public async Task Logout(Action? successAction = null) - { - string url = GetUrl(EndpointsConfiguration.Accounts.Logout); - string? token = await tokensService.GetRefreshToken(); - - HttpRequest request = new HttpRequest(HttpMethodType.Delete, url); - request.Headers.Add("Authorization", $"Bearer {token}"); - - HttpResponse response = await httpClientService.SendRequestAsync(request); - response.RegisterActionFor2XXSuccess(successAction) - .ExecuteAction(); - } - - public async Task GetAccountProfilePicture(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null) - { - string url = GetUrl(EndpointsConfiguration.Accounts.GetProfilePicture, id); - HttpRequest request = new HttpRequest(HttpMethodType.Get, url); - - HttpResponse response = await httpClientService.SendRequestAsync(request); - response.RegisterActionFor2XXSuccess(successAction) - .RegisterActionFor400BadRequest(badRequestAction) - .RegisterActionFor404NotFound(notFoundAction) - .ExecuteAction(); - } - - #endregion - - - - #region PRIVATE METHODS - - protected override string GetServiceBase() => EndpointsConfiguration.Accounts.Base; - - #endregion -} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/IAccountsWebAPIService.cs b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/IAccountsWebAPIService.cs deleted file mode 100644 index a2e0df5..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/IAccountsWebAPIService.cs +++ /dev/null @@ -1,12 +0,0 @@ -using WatchIt.Common.Model.Accounts; - -namespace WatchIt.Website.Services.WebAPI.Accounts; - -public interface IAccountsWebAPIService -{ - Task Register(RegisterRequest data, Action? createdAction = null, Action>? badRequestAction = null); - Task Authenticate(AuthenticateRequest data, Action? successAction = null, Action>? badRequestAction = null, Action? unauthorizedAction = null); - Task AuthenticateRefresh(Action? successAction = null, Action? unauthorizedAction = null, Action? forbiddenAction = null); - Task Logout(Action? successAction = null); - Task GetAccountProfilePicture(long id, Action? successAction = null, Action>? badRequestAction = null, Action? notFoundAction = null); -} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/WatchIt.Website.Services.WebAPI.Accounts.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/WatchIt.Website.Services.WebAPI.Accounts.csproj deleted file mode 100644 index ca5168e..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Accounts/WatchIt.Website.Services.WebAPI.Accounts.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/WatchIt.Website.Services.WebAPI.Common.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/WatchIt.Website.Services.WebAPI.Common.csproj deleted file mode 100644 index 642c1aa..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Common/WatchIt.Website.Services.WebAPI.Common.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/WatchIt.Website.Services.WebAPI.Genders.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/WatchIt.Website.Services.WebAPI.Genders.csproj deleted file mode 100644 index abf3359..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genders/WatchIt.Website.Services.WebAPI.Genders.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genres/WatchIt.Website.Services.WebAPI.Genres.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genres/WatchIt.Website.Services.WebAPI.Genres.csproj deleted file mode 100644 index 3a63532..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Genres/WatchIt.Website.Services.WebAPI.Genres.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net8.0 - enable - enable - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/WatchIt.Website.Services.WebAPI.Media.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/WatchIt.Website.Services.WebAPI.Media.csproj deleted file mode 100644 index ca5168e..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Media/WatchIt.Website.Services.WebAPI.Media.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/WatchIt.Website.Services.WebAPI.Movies.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/WatchIt.Website.Services.WebAPI.Movies.csproj deleted file mode 100644 index ef9c88f..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Movies/WatchIt.Website.Services.WebAPI.Movies.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net8.0 - enable - enable - - - - - ..\..\..\..\..\..\..\..\Program Files\dotnet\shared\Microsoft.AspNetCore.App\8.0.2\Microsoft.AspNetCore.Components.dll - - - - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/WatchIt.Website.Services.WebAPI.Persons.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/WatchIt.Website.Services.WebAPI.Persons.csproj deleted file mode 100644 index abf3359..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Persons/WatchIt.Website.Services.WebAPI.Persons.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/WatchIt.Website.Services.WebAPI.Photos.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/WatchIt.Website.Services.WebAPI.Photos.csproj deleted file mode 100644 index 79bbe83..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Photos/WatchIt.Website.Services.WebAPI.Photos.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/WatchIt.Website.Services.WebAPI.Roles.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/WatchIt.Website.Services.WebAPI.Roles.csproj deleted file mode 100644 index abf3359..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Roles/WatchIt.Website.Services.WebAPI.Roles.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/WatchIt.Website.Services.WebAPI.Series.csproj b/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/WatchIt.Website.Services.WebAPI.Series.csproj deleted file mode 100644 index abf3359..0000000 --- a/WatchIt.Website/WatchIt.Website.Services/WatchIt.Website.Services.WebAPI/WatchIt.Website.Services.WebAPI.Series/WatchIt.Website.Services.WebAPI.Series.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - diff --git a/WatchIt.Website/WatchIt.Website/App.razor b/WatchIt.Website/WatchIt.Website/App.razor index e5cba46..f460abd 100644 --- a/WatchIt.Website/WatchIt.Website/App.razor +++ b/WatchIt.Website/WatchIt.Website/App.razor @@ -10,10 +10,10 @@ - + - + diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/FilterFormComponent.cs b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/FilterFormComponent.cs similarity index 73% rename from WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/FilterFormComponent.cs rename to WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/FilterFormComponent.cs index 1df000c..19fa363 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/FilterFormComponent.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/FilterFormComponent.cs @@ -1,14 +1,14 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Query; -namespace WatchIt.Website.Components.Pages.DatabasePage.Subcomponents; +namespace WatchIt.Website.Components.Common.ListComponent; public abstract class FilterFormComponent : ComponentBase where TItem : IQueryOrderable where TQuery : QueryParameters { #region PARAMETERS [CascadingParameter] - protected DatabasePageComponent Parent { get; set; } + protected ListComponent Parent { get; set; } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor similarity index 94% rename from WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor rename to WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor index 0a3738a..6b614f6 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor @@ -60,6 +60,9 @@ PosterPlaceholder="@(PosterPlaceholder)" PosterDownloadingTask="@(action => PictureDownloadingTask(id, action))" GlobalRating="@(RatingSource(item))" + SecondaryRatingSingle="@(SecondaryRatingSingleSource?.Invoke(item))" + SecondaryRatingMultiple="@(SecondaryRatingMultipleSource?.Invoke(item))" + SecondaryRatingTitle="@(SecondaryRatingTitle)" GetGlobalRatingMethod="@(action => GetGlobalRatingMethod(id, action))" GetUserRatingMethod="@(GetUserRatingMethod is not null ? (user, actionSuccess, actionNotFound) => GetUserRatingMethod(id, user, actionSuccess, actionNotFound) : null)" PutRatingMethod="@(PutRatingMethod is not null ? (request) => PutRatingMethod(id, request) : null)" diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor.cs similarity index 89% rename from WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor.cs rename to WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor.cs index 6d07ab9..5591ee6 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/DatabasePageComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/ListComponent/ListComponent.razor.cs @@ -4,9 +4,9 @@ using WatchIt.Common.Model.Movies; using WatchIt.Common.Model.Rating; using WatchIt.Common.Query; -namespace WatchIt.Website.Components.Pages.DatabasePage; +namespace WatchIt.Website.Components.Common.ListComponent; -public partial class DatabasePageComponent : ComponentBase where TItem : IQueryOrderable where TQuery : QueryParameters +public partial class ListComponent : ComponentBase where TItem : IQueryOrderable where TQuery : QueryParameters { #region SERVICES @@ -23,6 +23,9 @@ public partial class DatabasePageComponent : ComponentBase where [Parameter] public required Func NameSource { get; set; } [Parameter] public Func AdditionalNameInfoSource { get; set; } = _ => null; [Parameter] public required Func RatingSource { get; set; } + [Parameter] public Func? SecondaryRatingSingleSource { get; set; } + [Parameter] public Func? SecondaryRatingMultipleSource { get; set; } + [Parameter] public string? SecondaryRatingTitle { get; set; } [Parameter] public required string UrlIdTemplate { get; set; } [Parameter] public required Func, Task> PictureDownloadingTask { get; set; } [Parameter] public required Func>, Task> ItemDownloadingTask { get; set; } @@ -33,7 +36,6 @@ public partial class DatabasePageComponent : ComponentBase where [Parameter] public Func? PutRatingMethod { get; set; } [Parameter] public Func? DeleteRatingMethod { get; set; } [Parameter] public required string PosterPlaceholder { get; set; } - #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor similarity index 60% rename from WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor rename to WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor index 572eb03..f1e5efe 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor @@ -1,12 +1,10 @@ -@using WatchIt.Website.Components.Pages.HomePage.Subcomponents - @typeparam TItem
- Top @(Count) @(Name) this week by popularity + @(Title) @if (_loaded) {
@@ -18,10 +16,10 @@ { @{int iCopy = i;} - + }
diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor.cs similarity index 71% rename from WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor.cs rename to WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor.cs index 61d983d..326590d 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Panels/ViewRankPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/HorizontalListPanelComponent.razor.cs @@ -3,20 +3,21 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model; using WatchIt.Common.Query; -namespace WatchIt.Website.Components.Pages.HomePage.Panels; +namespace WatchIt.Website.Components.Common.Panels; -public partial class ViewRankPanelComponent : ComponentBase +public partial class HorizontalListPanelComponent : ComponentBase { #region PARAMETERS [Parameter] public int Count { get; set; } = 5; - [Parameter] public required string Name {get; set; } - [Parameter] public required Func>, Task> GetViewRankAction { get; set; } + [Parameter] public required string Title {get; set; } + [Parameter] public required Func>, Task> GetItemsAction { get; set; } [Parameter] public required string ItemUrlFormatString { get; set; } [Parameter] public required Func IdSource { get; set; } [Parameter] public required Func NameSource { get; set; } - [Parameter] public required string PosterPlaceholder {get; set; } + [Parameter] public required string PosterPlaceholder { get; set; } [Parameter] public required Func, Task> GetPictureAction { get; set; } + [Parameter] public bool HidePlace { get; set; } #endregion @@ -43,7 +44,7 @@ public partial class ViewRankPanelComponent : ComponentBase // STEP 0 endTasks.AddRange( [ - GetViewRankAction(Count, data => _items = data) + GetItemsAction(data => _items = data) ]); // END diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor index 689936a..12bbc20 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor @@ -1,4 +1,4 @@ -
+
diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor.css index 8d33a8c..5baade5 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor.css +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/ItemPageHeaderPanelComponent.razor.css @@ -1,9 +1,5 @@ /* CLASSES */ -.mt-grid { - margin-top: 9rem !important; -} - .title-shadow { text-shadow: 2px 2px 2px #000; } diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor index 2264955..37613f4 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor @@ -2,7 +2,7 @@ @if (_loaded) {
- + @if (_pictureChanged || _pictureSaved is not null) { diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor.cs index 3bd56b1..1949048 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Panels/PictureEditorPanelComponent.razor.cs @@ -11,10 +11,12 @@ public partial class PictureEditorPanelComponent : ComponentBase [Parameter] public long? Id { get; set; } [Parameter] public int ContentWidth { get; set; } = 300; [Parameter] public required string PicturePlaceholder { get; set; } + [Parameter] public bool Circle { get; set; } [Parameter] public string Class { get; set; } = string.Empty; [Parameter] public required Func, Task> PictureGetTask { get; set; } [Parameter] public required Func, Task> PicturePutTask { get; set; } [Parameter] public required Func PictureDeleteTask { get; set; } + [Parameter] public Action? OnPictureChanged { get; set; } #endregion @@ -92,6 +94,7 @@ public partial class PictureEditorPanelComponent : ComponentBase _pictureSelected = data; _pictureChanged = false; _pictureSaving = false; + OnPictureChanged?.Invoke(data); } _pictureSaving = true; @@ -112,6 +115,7 @@ public partial class PictureEditorPanelComponent : ComponentBase _pictureSelected = null; _pictureChanged = false; _pictureDeleting = false; + OnPictureChanged?.Invoke(null); } _pictureDeleting = true; diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor new file mode 100644 index 0000000..6b532d5 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor.cs new file mode 100644 index 0000000..42d51f8 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/AccountPictureComponent.razor.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Common.Subcomponents; + +public partial class AccountPictureComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required long Id { get; set; } + [Parameter] public required int Size { get; set; } + + [Parameter] public string Class { get; set; } = string.Empty; + + #endregion + + + + #region FIELDS + + private AccountProfilePictureResponse? _picture; + + #endregion + + + + #region PUBLIC METHODS + + public async Task Reload() + { + await AccountsClientService.GetAccountProfilePicture(Id, data => _picture = data, notFoundAction: () => _picture = null); + StateHasChanged(); + } + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + await Reload(); + } + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor index da7a6c5..47a14b9 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor @@ -5,14 +5,18 @@ }
- @if (Rating is not null && Rating.Count > 0) + @if (SingleRating is not null) + { + @($"{SingleRating}/10") + } + else if (Rating is not null && Rating.Count > 0) { @($"{Math.Round(Rating.Average, 2)}/10") @(Rating.Count) } else { -
+
@if (Rating is null) {
/10
@@ -40,7 +44,7 @@ font-size: @((1.3 * Scale).ToCultureInvariantString())rem; } - #ratingNoItems { + #ratingSingleLine { font-size: @((1.3 * Scale).ToCultureInvariantString())rem; } diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor.cs index 8f6935e..8c8be62 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/DisplayRatingComponent.razor.cs @@ -8,6 +8,7 @@ public partial class DisplayRatingComponent : ComponentBase #region PARAMETERS [Parameter] public RatingResponse? Rating { get; set; } + [Parameter] public short? SingleRating { get; set; } [Parameter] public DisplayRatingComponentEmptyMode EmptyMode { get; set; } = DisplayRatingComponentEmptyMode.NoRatings; [Parameter] public double Scale { get; set; } = 1; diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor new file mode 100644 index 0000000..4030e10 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor @@ -0,0 +1,18 @@ +
+ +
+
+ @if (Place.HasValue) + { +
+
@(Place)
+
+ } +
+
+
@(Name)
+
+
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor.cs similarity index 83% rename from WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor.cs rename to WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor.cs index 16ec507..73b4506 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor.cs @@ -1,13 +1,13 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model; -namespace WatchIt.Website.Components.Pages.HomePage.Subcomponents; +namespace WatchIt.Website.Components.Common.Subcomponents; -public partial class ViewRankItemComponent : ComponentBase +public partial class HorizontalListItemComponent : ComponentBase { #region PARAMETERS - [Parameter] public required int Place { get; set; } + [Parameter] public int? Place { get; set; } [Parameter] public required string Name { get; set; } [Parameter] public required string PosterPlaceholder { get; set; } [Parameter] public required Func, Task> GetPosterAction { get; set; } diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor.css similarity index 100% rename from WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor.css rename to WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/HorizontalListItemComponent.razor.css diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor index 42b9837..1832c07 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor @@ -12,40 +12,67 @@ @(Name)@(string.IsNullOrWhiteSpace(AdditionalInfo) ? string.Empty : AdditionalInfo)
-
- -
- Global rating: - -
-
- @if (GetUserRatingMethod is not null && PutRatingMethod is not null && DeleteRatingMethod is not null) - { -
-
- Your rating: -
- @if (_user is null) - { - You must be logged in to rate - } - else if (!_userRatingLoaded) - { -
- - Loading... + + + + + @if (SecondaryRatingSingle is not null || SecondaryRatingMultiple is not null) + { + + } + @if (GetUserRatingMethod is not null && PutRatingMethod is not null && DeleteRatingMethod is not null) + { + + } + + + + + + @if (SecondaryRatingSingle is not null || SecondaryRatingMultiple is not null) + { + + } + @if (GetUserRatingMethod is not null && PutRatingMethod is not null && DeleteRatingMethod is not null) + { + + } + + +
+ Global rating: + + @(SecondaryRatingTitle): + + Your rating: +
+ + + + +
+ @if (_user is null) + { + You must be logged in to rate + } + else if (!_userRatingLoaded) + { +
+ + Loading... +
+ } + else + { + + }
- } - else - { - - } - - - } - +
diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.cs index 818f3ee..373ebd2 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model; using WatchIt.Common.Model.Rating; -using WatchIt.Website.Services.Utility.Authentication; +using WatchIt.Website.Services.Authentication; namespace WatchIt.Website.Components.Common.Subcomponents; @@ -27,6 +27,9 @@ public partial class ListItemComponent : ComponentBase [Parameter] public required Func, Task> PosterDownloadingTask { get; set; } [Parameter] public RatingResponse? GlobalRating { get; set; } + [Parameter] public short? SecondaryRatingSingle { get; set; } + [Parameter] public RatingResponse? SecondaryRatingMultiple { get; set; } + [Parameter] public string? SecondaryRatingTitle { get; set; } [Parameter] public required Func, Task> GetGlobalRatingMethod { get; set; } [Parameter] public Func, Action, Task>? GetUserRatingMethod { get; set; } [Parameter] public Func? PutRatingMethod { get; set; } diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.css index 7c26de1..195130b 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.css +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/ListItemComponent.razor.css @@ -1,10 +1,39 @@ -/* IDS */ +/* TAGS */ -#ratingNameText { - font-size: 14px; - font-weight: bold; +tbody, td, tfoot, th, thead, tr { + border-color: inherit; + border-style: unset; + border-width: 0; } + + +/* IDS */ + #ratingLoginInfoText { font-size: 13px; +} + +#ratingTable { + width: fit-content; + border-spacing: unset; + border-collapse: separate; + margin-left: -0.5rem !important; +} + +#ratingTable > thead > tr > th:not(:last-child) { + border-right: 1px solid #444; +} + +#ratingTable > tbody > tr > td:not(:last-child) { + border-right: 1px solid #444; +} + + + +/* CLASSES */ + +.rating-name-text { + font-size: 14px; + font-weight: bold; } \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor index 398c4d6..358a074 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor @@ -1 +1 @@ -@(AlternativeText) \ No newline at end of file +@(AlternativeText) \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor.cs index 213b9c2..08800d4 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Common/Subcomponents/PictureComponent.razor.cs @@ -14,6 +14,8 @@ public partial class PictureComponent : ComponentBase [Parameter] public string Class { get; set; } = string.Empty; [Parameter] public int? Height { get; set; } [Parameter] public int? Width { get; set; } + [Parameter] public bool Circle { get; set; } + [Parameter] public bool Shadow { get; set; } = true; #endregion @@ -40,6 +42,11 @@ public partial class PictureComponent : ComponentBase { _attributes.Add("width", Width.Value); } + + if (Circle) + { + AspectRatio = PictureComponentAspectRatio.Square; + } } #endregion @@ -71,6 +78,7 @@ public partial class PictureComponent : ComponentBase public static readonly PictureComponentAspectRatio Default = new PictureComponentAspectRatio(); public static readonly PictureComponentAspectRatio Photo = new PictureComponentAspectRatio(16, 9); + public static readonly PictureComponentAspectRatio Square = new PictureComponentAspectRatio(1, 1); #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/MoviesFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/MoviesFilterFormComponent.razor index d24e473..eac3a8d 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/MoviesFilterFormComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/MoviesFilterFormComponent.razor @@ -1,4 +1,4 @@ -@inherits FilterFormComponent +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor index 7f251bf..1979f14 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor @@ -1,5 +1,5 @@ @using WatchIt.Common.Model.Genders -@inherits FilterFormComponent +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs index ca4f085..778fb2d 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/PersonsFilterFormComponent.razor.cs @@ -1,7 +1,8 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Genders; using WatchIt.Common.Model.Persons; -using WatchIt.Website.Services.WebAPI.Genders; +using WatchIt.Website.Components.Common.ListComponent; +using WatchIt.Website.Services.Client.Genders; namespace WatchIt.Website.Components.Pages.DatabasePage.Subcomponents; @@ -9,7 +10,7 @@ public partial class PersonsFilterFormComponent : FilterFormComponent _genders = data) + GendersClientService.GetAllGenders(successAction: data => _genders = data) ]); // END diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/SeriesFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/SeriesFilterFormComponent.razor index 1bad8cc..141a655 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/SeriesFilterFormComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/DatabasePage/Subcomponents/SeriesFilterFormComponent.razor @@ -1,4 +1,4 @@ -@inherits FilterFormComponent +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent
diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor deleted file mode 100644 index 89c1a89..0000000 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/HomePage/Subcomponents/ViewRankItemComponent.razor +++ /dev/null @@ -1,13 +0,0 @@ -
- -
-
-
-
@(Place)
-
-
-
@(Name)
-
-
-
-
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaActorRolesEditPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaActorRolesEditPanelComponent.razor.cs index f152025..f539c69 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaActorRolesEditPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaActorRolesEditPanelComponent.razor.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Roles; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.MediaEditPage.Panels; @@ -12,9 +12,9 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -62,8 +62,8 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase { endTasks.AddRange( [ - MediaWebAPIService.GetMediaAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), - RolesWebAPIService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), + MediaClientService.GetMediaAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), + RolesClientService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), ]); } @@ -120,11 +120,11 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase _saving = true; if (_editedId.HasValue) { - await RolesWebAPIService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); + await RolesClientService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); } else { - await MediaWebAPIService.PostMediaActorRole(Id!.Value, _editedModel as ActorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized); + await MediaClientService.PostMediaActorRole(Id!.Value, _editedModel as ActorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized); } } @@ -141,7 +141,7 @@ public partial class MediaActorRolesEditPanelComponent : ComponentBase private async Task Delete(Guid id) { _roles[id] = (_roles[id].Data, true); - await RolesWebAPIService.DeleteActorRole(id, () => _roles.Remove(id)); + await RolesClientService.DeleteActorRole(id, () => _roles.Remove(id)); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaCreatorRolesEditPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaCreatorRolesEditPanelComponent.razor.cs index 46c61c7..6d1a131 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaCreatorRolesEditPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaEditPage/Panels/MediaCreatorRolesEditPanelComponent.razor.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Roles; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.MediaEditPage.Panels; @@ -12,9 +12,9 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -62,8 +62,8 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase { endTasks.AddRange( [ - MediaWebAPIService.GetMediaAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), - RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), + MediaClientService.GetMediaAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), + RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), ]); } @@ -119,11 +119,11 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase _saving = true; if (_editedId.HasValue) { - await RolesWebAPIService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); + await RolesClientService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); } else { - await MediaWebAPIService.PostMediaCreatorRole(Id!.Value, _editedModel as CreatorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized); + await MediaClientService.PostMediaCreatorRole(Id!.Value, _editedModel as CreatorRoleMediaRequest, SuccessPost, BadRequest, Unauthorized); } } @@ -140,7 +140,7 @@ public partial class MediaCreatorRolesEditPanelComponent : ComponentBase private async Task Delete(Guid id) { _roles[id] = (_roles[id].Data, true); - await RolesWebAPIService.DeleteCreatorRole(id, () => _roles.Remove(id)); + await RolesClientService.DeleteCreatorRole(id, () => _roles.Remove(id)); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor index 80804ab..f373100 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor @@ -10,17 +10,17 @@ TQuery="ActorRoleMediaQueryParameters" TRoleParent="PersonResponse" Id="@(Id)" - GetRolesAction="@(MediaWebAPIService.GetMediaAllActorRoles)" + GetRolesAction="@(MediaClientService.GetMediaAllActorRoles)" NameSource="@((_, parent) => parent.Name)" AdditionalInfoSource="@((item, _) => $" as {item.Name}")" - GetRoleParentMethod="@((id, action) => PersonsWebAPIService.GetPerson(id, action))" + GetRoleParentMethod="@((id, action) => PersonsClientService.GetPerson(id, action))" ParentItemIdSource="@(item => item.PersonId)" ParentUrlTemplate="/person/{0}" PosterPlaceholder="/assets/person_poster.png" - PosterDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))" - GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetActorRoleRating(id, action))" - GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" - PutRatingMethod="@((id, request) => RolesWebAPIService.PutActorRoleRating(id, request))" - DeleteRatingMethod="@(id => RolesWebAPIService.DeleteActorRoleRating(id))"/> + PosterDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))" + GetGlobalRatingMethod="@((id, action) => RolesClientService.GetActorRoleRating(id, action))" + GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" + PutRatingMethod="@((id, request) => RolesClientService.PutActorRoleRating(id, request))" + DeleteRatingMethod="@(id => RolesClientService.DeleteActorRoleRating(id))"/>
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor.cs index 54e7287..4cd13fb 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaActorRolesPanelComponent.razor.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Components; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.MediaPage.Panels; @@ -10,9 +10,9 @@ public partial class MediaActorRolesPanelComponent : ComponentBase { #region SERVICES - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor index 3361227..851721f 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor @@ -22,17 +22,17 @@ TRoleParent="PersonResponse" Id="@(Id)" Query="@(_query)" - GetRolesAction="@(MediaWebAPIService.GetMediaAllCreatorRoles)" + GetRolesAction="@(MediaClientService.GetMediaAllCreatorRoles)" NameSource="@((_, parent) => parent.Name)" - GetRoleParentMethod="@((id, action) => PersonsWebAPIService.GetPerson(id, action))" + GetRoleParentMethod="@((id, action) => PersonsClientService.GetPerson(id, action))" ParentItemIdSource="@(item => item.PersonId)" ParentUrlTemplate="/person/{0}" PosterPlaceholder="/assets/person_poster.png" - PosterDownloadingTask="@((id, action) => PersonsWebAPIService.GetPersonPhoto(id, action))" - GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetCreatorRoleRating(id, action))" - GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" - PutRatingMethod="@((id, request) => RolesWebAPIService.PutCreatorRoleRating(id, request))" - DeleteRatingMethod="@((id) => RolesWebAPIService.DeleteCreatorRoleRating(id))"/> + PosterDownloadingTask="@((id, action) => PersonsClientService.GetPersonPhoto(id, action))" + GetGlobalRatingMethod="@((id, action) => RolesClientService.GetCreatorRoleRating(id, action))" + GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" + PutRatingMethod="@((id, request) => RolesClientService.PutCreatorRoleRating(id, request))" + DeleteRatingMethod="@((id) => RolesClientService.DeleteCreatorRoleRating(id))"/>
} else diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor.cs index c1bb1b4..3d86984 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/MediaPage/Panels/MediaCreatorRolesPanelComponent.razor.cs @@ -2,10 +2,10 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Roles; using WatchIt.Website.Components.Common.Subcomponents; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.MediaPage.Panels; @@ -13,9 +13,9 @@ public partial class MediaCreatorRolesPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -54,7 +54,7 @@ public partial class MediaCreatorRolesPanelComponent : ComponentBase // STEP 0 endTasks.AddRange( [ - RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data) + RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data) ]); // END diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonActorRolesEditPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonActorRolesEditPanelComponent.razor.cs index b462c9e..95a40ab 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonActorRolesEditPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonActorRolesEditPanelComponent.razor.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Roles; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels; @@ -11,9 +11,9 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -61,8 +61,8 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase { endTasks.AddRange( [ - PersonsWebAPIService.GetPersonAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), - RolesWebAPIService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), + PersonsClientService.GetPersonAllActorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), + RolesClientService.GetAllActorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), ]); } @@ -122,11 +122,11 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase _saving = true; if (_editedId.HasValue) { - await RolesWebAPIService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); + await RolesClientService.PutActorRole(_editedId.Value, _editedModel as ActorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); } else { - await PersonsWebAPIService.PostPersonActorRole(Id!.Value, _editedModel as ActorRolePersonRequest, SuccessPost, BadRequest, Unauthorized); + await PersonsClientService.PostPersonActorRole(Id!.Value, _editedModel as ActorRolePersonRequest, SuccessPost, BadRequest, Unauthorized); } } @@ -143,7 +143,7 @@ public partial class PersonActorRolesEditPanelComponent : ComponentBase private async Task Delete(Guid id) { _roles[id] = (_roles[id].Data, true); - await RolesWebAPIService.DeleteActorRole(id, () => _roles.Remove(id)); + await RolesClientService.DeleteActorRole(id, () => _roles.Remove(id)); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonCreatorRolesEditPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonCreatorRolesEditPanelComponent.razor.cs index ca9b0c6..11a81d3 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonCreatorRolesEditPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonCreatorRolesEditPanelComponent.razor.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Roles; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels; @@ -11,9 +11,9 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -61,8 +61,8 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase { endTasks.AddRange( [ - PersonsWebAPIService.GetPersonAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), - RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), + PersonsClientService.GetPersonAllCreatorRoles(Id.Value, successAction: data => _roles = data.ToDictionary(x => x.Id, x => (x, false))), + RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data.ToDictionary(x => x.Id, x => x.Name)), ]); } @@ -121,11 +121,11 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase _saving = true; if (_editedId.HasValue) { - await RolesWebAPIService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); + await RolesClientService.PutCreatorRole(_editedId.Value, _editedModel as CreatorRoleUniversalRequest, SuccessPut, BadRequest, Unauthorized); } else { - await PersonsWebAPIService.PostPersonCreatorRole(Id!.Value, _editedModel as CreatorRolePersonRequest, SuccessPost, BadRequest, Unauthorized); + await PersonsClientService.PostPersonCreatorRole(Id!.Value, _editedModel as CreatorRolePersonRequest, SuccessPost, BadRequest, Unauthorized); } } @@ -142,7 +142,7 @@ public partial class PersonCreatorRolesEditPanelComponent : ComponentBase private async Task Delete(Guid id) { _roles[id] = (_roles[id].Data, true); - await RolesWebAPIService.DeleteCreatorRole(id, () => _roles.Remove(id)); + await RolesClientService.DeleteCreatorRole(id, () => _roles.Remove(id)); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonEditFormPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonEditFormPanelComponent.razor.cs index c76a9ff..98be2da 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonEditFormPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonEditPage/Panels/PersonEditFormPanelComponent.razor.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Genders; using WatchIt.Common.Model.Persons; -using WatchIt.Website.Services.WebAPI.Genders; -using WatchIt.Website.Services.WebAPI.Persons; +using WatchIt.Website.Services.Client.Genders; +using WatchIt.Website.Services.Client.Persons; namespace WatchIt.Website.Components.Pages.PersonEditPage.Panels; @@ -11,8 +11,8 @@ public partial class PersonEditFormPanelComponent : ComponentBase #region SERVICES [Inject] private NavigationManager NavigationManager { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IGendersWebAPIService GendersWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IGendersClientService GendersClientService { get; set; } = default!; #endregion @@ -52,13 +52,13 @@ public partial class PersonEditFormPanelComponent : ComponentBase // STEP 0 endTasks.AddRange( [ - GendersWebAPIService.GetAllGenders(successAction: data => _genders = data) + GendersClientService.GetAllGenders(successAction: data => _genders = data) ]); if (Id.HasValue) { endTasks.AddRange( [ - PersonsWebAPIService.GetPerson(Id.Value, data => _person = new PersonRequest(data)) + PersonsClientService.GetPerson(Id.Value, data => _person = new PersonRequest(data)) ]); } @@ -98,11 +98,11 @@ public partial class PersonEditFormPanelComponent : ComponentBase _saving = true; if (Id.HasValue) { - await PersonsWebAPIService.PutPerson(Id.Value, _person, PutSuccess, BadRequest, AuthError, AuthError); + await PersonsClientService.PutPerson(Id.Value, _person, PutSuccess, BadRequest, AuthError, AuthError); } else { - await PersonsWebAPIService.PostPerson(_person, PostSuccess, BadRequest, AuthError, AuthError); + await PersonsClientService.PostPerson(_person, PostSuccess, BadRequest, AuthError, AuthError); } } diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor index 88a40e8..068bd6d 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor @@ -10,18 +10,18 @@ TQuery="ActorRolePersonQueryParameters" TRoleParent="MediaResponse" Id="@(Id)" - GetRolesAction="@(PersonsWebAPIService.GetPersonAllActorRoles)" + GetRolesAction="@(PersonsClientService.GetPersonAllActorRoles)" NameSource="@((_, parent) => parent.Title)" AdditionalInfoSource="@((item, _) => $" as {item.Name}")" - GetRoleParentMethod="@((id, action) => MediaWebAPIService.GetMedia(id, action))" + GetRoleParentMethod="@((id, action) => MediaClientService.GetMedia(id, action))" ParentItemIdSource="@(item => item.MediaId)" ParentUrlTemplate="/media/{0}" PosterPlaceholder="/assets/media_poster.png" - PosterDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))" - GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetActorRoleRating(id, action))" - GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" - PutRatingMethod="@((id, request) => RolesWebAPIService.PutActorRoleRating(id, request))" - DeleteRatingMethod="@(id => RolesWebAPIService.DeleteActorRoleRating(id))" + PosterDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))" + GetGlobalRatingMethod="@((id, action) => RolesClientService.GetActorRoleRating(id, action))" + GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetActorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" + PutRatingMethod="@((id, request) => RolesClientService.PutActorRoleRating(id, request))" + DeleteRatingMethod="@(id => RolesClientService.DeleteActorRoleRating(id))" OnRatingChanged="@(OnRatingChanged)"/>
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor.cs index 4b87639..20f6776 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonActorRolesPanelComponent.razor.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Components; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.PersonPage.Panels; @@ -9,9 +9,9 @@ public partial class PersonActorRolesPanelComponent : ComponentBase { #region SERVICES - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor index 609b18a..73173b9 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor @@ -22,17 +22,17 @@ TRoleParent="MediaResponse" Id="@(Id)" Query="@(_query)" - GetRolesAction="@(PersonsWebAPIService.GetPersonAllCreatorRoles)" + GetRolesAction="@(PersonsClientService.GetPersonAllCreatorRoles)" NameSource="@((_, parent) => parent.Title)" - GetRoleParentMethod="@((id, action) => MediaWebAPIService.GetMedia(id, action))" + GetRoleParentMethod="@((id, action) => MediaClientService.GetMedia(id, action))" ParentItemIdSource="@(item => item.MediaId)" ParentUrlTemplate="/media/{0}" PosterPlaceholder="/assets/media_poster.png" - PosterDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))" - GetGlobalRatingMethod="@((id, action) => RolesWebAPIService.GetCreatorRoleRating(id, action))" - GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesWebAPIService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" - PutRatingMethod="@((id, request) => RolesWebAPIService.PutCreatorRoleRating(id, request))" - DeleteRatingMethod="@((id) => RolesWebAPIService.DeleteCreatorRoleRating(id))" + PosterDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))" + GetGlobalRatingMethod="@((id, action) => RolesClientService.GetCreatorRoleRating(id, action))" + GetUserRatingMethod="@((id, userId, actionSuccess, actionNotFound) => RolesClientService.GetCreatorRoleRatingByUser(id, userId, actionSuccess, actionNotFound))" + PutRatingMethod="@((id, request) => RolesClientService.PutCreatorRoleRating(id, request))" + DeleteRatingMethod="@((id) => RolesClientService.DeleteCreatorRoleRating(id))" OnRatingChanged="@(OnRatingChanged)"/>
} diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor.cs index ac6f353..98fefb2 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonCreatorRolesPanelComponent.razor.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Roles; using WatchIt.Website.Components.Common.Subcomponents; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Roles; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Roles; namespace WatchIt.Website.Components.Pages.PersonPage.Panels; @@ -12,9 +12,9 @@ public partial class PersonCreatorRolesPanelComponent : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IRolesWebAPIService RolesWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IRolesClientService RolesClientService { get; set; } = default!; #endregion @@ -54,7 +54,7 @@ public partial class PersonCreatorRolesPanelComponent : ComponentBase // STEP 0 endTasks.AddRange( [ - RolesWebAPIService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data) + RolesClientService.GetAllCreatorRoleTypes(successAction: data => _roleTypes = data) ]); // END diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonRatingPanel.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonRatingPanel.razor.cs index 4e57c54..45d5b55 100644 --- a/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonRatingPanel.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/PersonPage/Panels/PersonRatingPanel.razor.cs @@ -1,7 +1,7 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Rating; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Persons; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Persons; namespace WatchIt.Website.Components.Pages.PersonPage.Panels; @@ -10,7 +10,7 @@ public partial class PersonRatingPanel : ComponentBase #region SERVICES [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; #endregion @@ -83,13 +83,13 @@ public partial class PersonRatingPanel : ComponentBase } } - protected async Task UpdateGlobalRating() => await PersonsWebAPIService.GetPersonGlobalRating(Id, data => Rating = data); + protected async Task UpdateGlobalRating() => await PersonsClientService.GetPersonGlobalRating(Id, data => Rating = data); protected async Task UpdateUserRating() { if (_user is not null) { - await PersonsWebAPIService.GetPersonUserRating(Id, _user.Id, data => _userRating = data); + await PersonsClientService.GetPersonUserRating(Id, _user.Id, data => _userRating = data); } } diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor new file mode 100644 index 0000000..cb5dd8e --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor @@ -0,0 +1,77 @@ +@using Blazorise.Extensions +@using WatchIt.Website.Components.Pages.SearchPage.Subcomponents + + + +
+
+
+
+

Users

+
+
+ @if (_loaded) + { + if (!_items.IsNullOrEmpty()) + { + for (int i = 0; i < _items.Count; i++) + { + if (i > 0) + { +
+
+
+
+
+ } +
+
+ @{ + int iCopy = i; + } + +
+
+ } + if (!_allItemsLoaded) + { +
+
+
+ +
+
+
+ } + } + else + { +
+
+
+ No items found +
+
+
+ } + } + else + { +
+
+ +
+
+ } +
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor.cs new file mode 100644 index 0000000..42b7197 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Panels/UsersSearchResultPanelComponent.razor.cs @@ -0,0 +1,97 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.SearchPage.Panels; + +public partial class UsersSearchResultPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required string Query { get; set; } + + #endregion + + + + #region FIELDS + + private bool _loaded; + + private AccountQueryParameters _query = new AccountQueryParameters + { + First = 5 + }; + + private List _items = []; + private bool _allItemsLoaded; + private bool _itemsLoading; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + // INIT + _query.Username = Query; + + List endTasks = new List(); + + // STEP 0 + endTasks.AddRange( + [ + AccountsClientService.GetAccounts(_query, data => + { + _items.AddRange(data); + if (data.Count() < 5) + { + _allItemsLoaded = true; + } + else + { + _query.After = 5; + } + }) + ]); + + // END + await Task.WhenAll(endTasks); + + _loaded = true; + StateHasChanged(); + } + } + + private async Task DownloadItems() + { + _itemsLoading = true; + await AccountsClientService.GetAccounts(_query, data => + { + _items.AddRange(data); + if (data.Count() < 5) + { + _allItemsLoaded = true; + } + else + { + _query.After += 5; + } + _itemsLoading = false; + }); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor new file mode 100644 index 0000000..dc936c9 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor @@ -0,0 +1,7 @@ + +
+ +

@(Item.Username)

+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor.cs new file mode 100644 index 0000000..b81a075 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/SearchPage/Subcomponents/UserSearchResultItemComponent.razor.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; + +namespace WatchIt.Website.Components.Pages.SearchPage.Subcomponents; + +public partial class UserSearchResultItemComponent : ComponentBase +{ + #region PROPERTIES + + [Parameter] public required AccountResponse Item { get; set; } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/AccountEditHeaderPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/AccountEditHeaderPanelComponent.razor new file mode 100644 index 0000000..a051670 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/AccountEditHeaderPanelComponent.razor @@ -0,0 +1,5 @@ +
+
+

Account settings

+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor new file mode 100644 index 0000000..612abe7 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor @@ -0,0 +1,46 @@ +
+
+

Change email

+ @if (_data is not null) + { + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ @if (!string.IsNullOrWhiteSpace(_error)) + { + @(_error) + } + else if (_saved) + { + New email saved! + } +
+
+ +
+
+
+
+ } + else + { + + } +
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor.cs new file mode 100644 index 0000000..77043e6 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewEmailPanelComponent.razor.cs @@ -0,0 +1,83 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class NewEmailPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required AccountResponse AccountData { get; set; } + + #endregion + + + + #region FIELDS + + private AccountEmailRequest? _data; + private string? _error; + private bool _saving; + private bool _saved; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _data = new AccountEmailRequest + { + NewEmail = AccountData.Email, + }; + StateHasChanged(); + } + } + + private async Task Save() + { + void Success() + { + _saved = true; + _saving = false; + _data = new AccountEmailRequest + { + NewEmail = _data!.NewEmail + }; + NavigationManager.Refresh(true); + } + + void BadRequest(IDictionary errors) + { + _error = errors.SelectMany(x => x.Value).FirstOrDefault() ?? "Unknown error"; + _saving = false; + } + + void Unauthorized() + { + _error = "Incorrect password"; + _saving = false; + } + + _saving = true; + _saved = false; + _error = null; + await AccountsClientService.PatchAccountEmail(_data!, Success, BadRequest, Unauthorized); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor new file mode 100644 index 0000000..1a869ac --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor @@ -0,0 +1,45 @@ +
+
+

Change password

+ + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ @if (!string.IsNullOrWhiteSpace(_error)) + { + @(_error) + } + else if (_saved) + { + New email saved! + } +
+
+ +
+
+
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor.cs new file mode 100644 index 0000000..7655c8c --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewPasswordPanelComponent.razor.cs @@ -0,0 +1,60 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class NewPasswordPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private AccountPasswordRequest _data = new AccountPasswordRequest(); + private string? _error; + private bool _saving; + private bool _saved; + + #endregion + + + + #region PRIVATE METHODS + + private async Task Save() + { + void Success() + { + _saved = true; + _saving = false; + _data = new AccountPasswordRequest(); + NavigationManager.Refresh(true); + } + + void BadRequest(IDictionary errors) + { + _error = errors.SelectMany(x => x.Value).FirstOrDefault() ?? "Unknown error"; + _saving = false; + } + + void Unauthorized() + { + _error = "Incorrect password"; + _saving = false; + } + + _saving = true; + _saved = false; + _error = null; + await AccountsClientService.PatchAccountPassword(_data, Success, BadRequest, Unauthorized); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor new file mode 100644 index 0000000..62a6a9b --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor @@ -0,0 +1,46 @@ +
+
+

Change username

+ @if (_data is not null) + { + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ @if (!string.IsNullOrWhiteSpace(_error)) + { + @(_error) + } + else if (_saved) + { + New username saved! + } +
+
+ +
+
+
+
+ } + else + { + + } +
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor.cs new file mode 100644 index 0000000..39eeb7f --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/NewUsernamePanelComponent.razor.cs @@ -0,0 +1,84 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class NewUsernamePanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required AccountResponse AccountData { get; set; } + + #endregion + + + + #region FIELDS + + private AccountUsernameRequest? _data; + private string? _error; + private bool _saving; + private bool _saved; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _data = new AccountUsernameRequest + { + NewUsername = AccountData.Username, + }; + StateHasChanged(); + } + } + + private async Task Save() + { + void Success() + { + _saved = true; + _saving = false; + _data = new AccountUsernameRequest + { + NewUsername = _data!.NewUsername + }; + NavigationManager.Refresh(true); + } + + void BadRequest(IDictionary errors) + { + _error = errors.SelectMany(x => x.Value).FirstOrDefault() ?? "Unknown error"; + _saving = false; + } + + void Unauthorized() + { + _error = "Incorrect password"; + _saving = false; + } + + _saving = true; + _saved = false; + _error = null; + await AccountsClientService.PatchAccountUsername(_data!, Success, BadRequest, Unauthorized); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor new file mode 100644 index 0000000..6281e1a --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor @@ -0,0 +1,121 @@ +@using Blazorise.Components +@using WatchIt.Common.Model.Photos + + + +
+ @if (_loaded) + { +
+
+

Profile background

+ @if (_editMode) + { + + } + else + { + + + } +
+ @if (_editMode) + { +
+
+
+
+ + Sorry... @not_found_context was not found + +
+
+ +
+
+
+ @if (_mediaPhotos is null) + { + Select media first + } + else if (!_mediaPhotos.Any()) + { + No backgrounds for this media + } + else + { +
+ @foreach (PhotoResponse photo in _mediaPhotos) + { +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ } +
+ } +
+ } + else + { + if (_selectedPhoto is not null) + { + + } + else + { + You don't have selected background. Click "Edit" to choose one. + } + } +
+ } + else + { + + } +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.cs new file mode 100644 index 0000000..594ba75 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.cs @@ -0,0 +1,128 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Media; +using WatchIt.Common.Model.Photos; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Media; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class ProfileBackgroundEditorPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required long Id { get; set; } + [Parameter] public Action? OnBackgroundChanged { get; set; } + + #endregion + + + + #region FIELDS + + private bool _loaded; + + private bool _editMode; + private long? _selectedMedia; + private IEnumerable? _mediaPhotos; + private bool _backgroundsLoading; + private bool _saveLoading; + + private bool _removeLoading; + + private IEnumerable _mediaList = default!; + + private PhotoResponse? _selectedPhoto; + private MediaResponse? _selectedPhotoMedia; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + await Task.WhenAll( + [ + MediaClientService.GetAllMedia(successAction: data => _mediaList = data), + AccountsClientService.GetAccountProfileBackground(Id, data => _selectedPhoto = data) + ]); + + if (_selectedPhoto is not null) + { + _selectedPhotoMedia = _mediaList.First(x => x.Id == _selectedPhoto.MediaId); + } + + _loaded = true; + StateHasChanged(); + } + } + + private async Task Save(Guid id) + { + _saveLoading = true; + await AccountsClientService.PutAccountProfileBackground(new AccountProfileBackgroundRequest(id), data => + { + OnBackgroundChanged?.Invoke(data); + _selectedPhoto = data; + _selectedPhotoMedia = _mediaList.First(x => x.Id == _selectedMedia!.Value); + _saveLoading = false; + Cancel(); + }); + } + + private void Cancel() + { + _editMode = false; + _selectedMedia = default; + _saveLoading = false; + _backgroundsLoading = false; + _mediaPhotos = default; + } + + private void Edit() + { + _editMode = true; + } + + private async Task Remove() + { + _removeLoading = true; + await AccountsClientService.DeleteAccountProfileBackground(() => + { + OnBackgroundChanged?.Invoke(null); + _selectedPhoto = null; + _selectedPhotoMedia = null; + _removeLoading = false; + }); + } + + private async Task LoadBackgrounds() + { + _backgroundsLoading = true; + PhotoQueryParameters query = new PhotoQueryParameters + { + IsBackground = true + }; + await MediaClientService.GetMediaPhotos(_selectedMedia!.Value, query, successAction: data => + { + _mediaPhotos = data; + _backgroundsLoading = false; + }); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.css new file mode 100644 index 0000000..910ae4d --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileBackgroundEditorPanelComponent.razor.css @@ -0,0 +1,23 @@ +/* IDS */ + +#scrollPhotos { + overflow-x: scroll; + + border-color: grey; + border-width: 1px; + border-style: solid; + border-radius: 10px; +} + +#backgroundIndicator { + height: 30px; + width: 30px; +} + + + +/* CLASSES */ + +.photo-container { + width: 350px; +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor new file mode 100644 index 0000000..b5a326d --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor @@ -0,0 +1,60 @@ +@using WatchIt.Common.Model.Genders + + + +
+ @if (_loaded) + { +
+

Basic profile info

+ + +
+
+ +
+ +
+
+
+ +
+ + + @foreach (GenderResponse gender in _genders) + { + + } + +
+
+
+
+ @if (!string.IsNullOrWhiteSpace(_error)) + { + @(_error) + } +
+
+ +
+
+
+
+
+ } + else + { + + } +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor.cs new file mode 100644 index 0000000..7407687 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditFormPanelComponent.razor.cs @@ -0,0 +1,83 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Genders; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Genders; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class ProfileEditFormPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] private IGendersClientService GendersClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required AccountResponse AccountData { get; set; } + [Parameter] public string Class { get; set; } = string.Empty; + + #endregion + + + + #region FIELDS + + private bool _loaded; + private bool _saving; + private string? _error; + + private IEnumerable _genders = []; + + private AccountProfileInfoRequest _accountProfileInfo = new AccountProfileInfoRequest(); + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + _accountProfileInfo = new AccountProfileInfoRequest(AccountData); + await GendersClientService.GetAllGenders(successAction: data => _genders = data); + + _loaded = true; + StateHasChanged(); + } + } + + private async Task Save() + { + void Success() + { + _error = null; + _saving = false; + } + + void BadRequest(IDictionary errors) + { + _error = errors.SelectMany(x => x.Value).FirstOrDefault() ?? "Unknown error"; + _saving = false; + } + + void AuthError() + { + _error = "Authentication error"; + _saving = false; + } + + _saving = true; + await AccountsClientService.PutAccountProfileInfo(_accountProfileInfo, Success, BadRequest, AuthError); + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditHeaderPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditHeaderPanelComponent.razor new file mode 100644 index 0000000..6385348 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/ProfileEditHeaderPanelComponent.razor @@ -0,0 +1,5 @@ +
+
+

Profile settings

+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor new file mode 100644 index 0000000..f9a9c48 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor @@ -0,0 +1,9 @@ +
+
+ +
+

@(AccountData.Username)

+ User settings +
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.cs new file mode 100644 index 0000000..7700867 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Components.Common.Subcomponents; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.UserEditPage.Panels; + +public partial class UserEditPageHeaderPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] public IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] public NavigationManager NavigationManager { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required AccountResponse AccountData { get; set; } + + #endregion + + + + #region FIELDS + + private AccountPictureComponent _accountPicture = default!; + + #endregion + + + + #region PUBLIC METHODS + + public async Task ReloadPicture() => await _accountPicture.Reload(); + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.css new file mode 100644 index 0000000..7044add --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserEditPage/Panels/UserEditPageHeaderPanelComponent.razor.css @@ -0,0 +1,9 @@ +/* IDS */ + +#username { + margin-top: -8px !important; +} + +#secondaryText { + color: lightgray !important; +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor new file mode 100644 index 0000000..28059b2 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor @@ -0,0 +1,30 @@ +
+ +
+
+
+
+

@(AccountProfileInfoData.Username)

+
+ @if (!string.IsNullOrWhiteSpace(AccountProfileInfoData.Description)) + { + + @(AccountProfileInfoData.Description) + + } + +
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.cs new file mode 100644 index 0000000..a7d9ecd --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.cs @@ -0,0 +1,57 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Components.Pages.UserPage.Panels; + +public partial class UserPageHeaderPanelComponent : ComponentBase +{ + #region SERVICES + + [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public required AccountResponse AccountProfileInfoData { get; set; } + + #endregion + + + + #region FIELDS + + private AccountProfilePictureResponse? _accountProfilePicture; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + List endTasks = new List(); + + // STEP 0 + endTasks.AddRange( + [ + AccountsClientService.GetAccountProfilePicture(AccountProfileInfoData.Id, data => _accountProfilePicture = data), + ]); + + // END + await Task.WhenAll(endTasks); + + StateHasChanged(); + } + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.css b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.css new file mode 100644 index 0000000..1fcbf05 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Panels/UserPageHeaderPanelComponent.razor.css @@ -0,0 +1,9 @@ +/* IDS */ + +#base { + margin-top: 120px; +} + +#space { + height: 100px; +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/MoviesRatedFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/MoviesRatedFilterFormComponent.razor new file mode 100644 index 0000000..a5ddc12 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/MoviesRatedFilterFormComponent.razor @@ -0,0 +1,82 @@ +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent + + + + +
+
+
+ Title + +
+
+
+
+ Original title + +
+
+
+
+ Description + +
+
+
+
+ Release date + + - + +
+
+
+
+ Length + + - + +
+
+
+
+ Budget + + - + +
+
+
+
+ Rating (count) + + - + +
+
+
+
+ Rating (average) + + - + +
+
+
+
+ User rating + + - + +
+
+
+
+ User rating date + + - + +
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor new file mode 100644 index 0000000..e1fe738 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor @@ -0,0 +1,96 @@ +@using WatchIt.Common.Model.Genders + +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent + + + + +
+
+
+ Name + +
+
+
+
+ Full name + +
+
+
+
+ Description + +
+
+
+
+ Birth date + + - + +
+
+
+
+ Death date + + - + +
+
+
+
+ Gender + + + @foreach (GenderResponse gender in _genders) + { + + } + +
+
+
+
+ Rating (count) + + - + +
+
+
+
+ Rating (average) + + - + +
+
+
+
+ User rating (count) + + - + +
+
+
+
+ User rating (average) + + - + +
+
+
+
+ User rating (date) + + - + +
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor.cs b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor.cs new file mode 100644 index 0000000..5f38b2f --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/PersonsRatedFilterFormComponent.razor.cs @@ -0,0 +1,49 @@ +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Genders; +using WatchIt.Common.Model.Persons; +using WatchIt.Website.Components.Common.ListComponent; +using WatchIt.Website.Services.Client.Genders; + +namespace WatchIt.Website.Components.Pages.UserPage.Subcomponents; + +public partial class PersonsRatedFilterFormComponent : FilterFormComponent +{ + #region SERVICES + + [Inject] private IGendersClientService GendersClientService { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private IEnumerable _genders = []; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + List endTasks = new List(); + + // STEP 0 + endTasks.AddRange( + [ + GendersClientService.GetAllGenders(successAction: data => _genders = data) + ]); + + // END + await Task.WhenAll(endTasks); + + StateHasChanged(); + } + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/SeriesRatedFilterFormComponent.razor b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/SeriesRatedFilterFormComponent.razor new file mode 100644 index 0000000..2a93f8d --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Components/Pages/UserPage/Subcomponents/SeriesRatedFilterFormComponent.razor @@ -0,0 +1,85 @@ +@inherits WatchIt.Website.Components.Common.ListComponent.FilterFormComponent + + +
+
+
+ Title + +
+
+
+
+ Original title + +
+
+
+
+ Description + +
+
+
+
+ Release date + + - + +
+
+
+
+ Length + + - + +
+
+
+
+ Has ended +
+ + + + + + +
+
+
+
+
+ Rating (count) + + - + +
+
+
+
+ Rating (average) + + - + +
+
+
+
+ User rating + + - + +
+
+
+
+ User rating date + + - + +
+
+
+
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor index 63f25b6..736e311 100644 --- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor @@ -1,6 +1,6 @@ @using System.Net @using WatchIt.Common.Model.Photos -@using WatchIt.Website.Services.WebAPI.Photos +@using WatchIt.Website.Services.Client.Photos @inherits LayoutComponentBase @@ -53,16 +53,19 @@ else { - - + + Your profile + User settings @if (_user.IsAdmin) { + Administrator panel } @@ -77,7 +80,7 @@
-
+
@Body
diff --git a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs index db6a271..d0df615 100644 --- a/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Layout/MainLayout.razor.cs @@ -2,11 +2,12 @@ using System.Net; using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Accounts; using WatchIt.Common.Model.Photos; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Accounts; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Photos; +using WatchIt.Website.Components.Common.Subcomponents; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Tokens; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Photos; namespace WatchIt.Website.Layout; @@ -18,9 +19,9 @@ public partial class MainLayout : LayoutComponentBase [Inject] public NavigationManager NavigationManager { get; set; } = default!; [Inject] public ITokensService TokensService { get; set; } = default!; [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!; + [Inject] public IMediaClientService MediaClientService { get; set; } = default!; + [Inject] public IPhotosClientService PhotosClientService { get; set; } = default!; + [Inject] public IAccountsClientService AccountsClientService { get; set; } = default!; #endregion @@ -28,11 +29,13 @@ public partial class MainLayout : LayoutComponentBase #region FIELDS + private AccountPictureComponent? _profilePicture; + private bool _loaded; private User? _user; + private AccountResponse? _accountData; private PhotoResponse? _defaultBackgroundPhoto; - private AccountProfilePictureResponse? _userProfilePicture; private bool _searchbarVisible; private string _searchbarText = string.Empty; @@ -55,6 +58,20 @@ public partial class MainLayout : LayoutComponentBase } #endregion + + + + #region PUBLIC METHODS + + public async Task ReloadProfilePicture() + { + if (_profilePicture is not null) + { + await _profilePicture.Reload(); + } + } + + #endregion @@ -66,32 +83,17 @@ public partial class MainLayout : LayoutComponentBase { if (firstRender) { - List endTasks = new List(); - List step1Tasks = new List(); - - // STEP 0 - step1Tasks.AddRange( + await Task.WhenAll( [ - Task.Run(async () => _user = await AuthenticationService.GetUserAsync()) + Task.Run(async () => _user = await AuthenticationService.GetUserAsync()), + PhotosClientService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data) ]); - endTasks.AddRange( - [ - PhotosWebAPIService.GetPhotoRandomBackground(data => _defaultBackgroundPhoto = data) - ]); - - // STEP 1 - await Task.WhenAll(step1Tasks); + if (_user is not null) { - endTasks.AddRange( - [ - AccountsWebAPIService.GetAccountProfilePicture(_user.Id, data => _userProfilePicture = data) - ]); + await AccountsClientService.GetAccount(_user.Id, data => _accountData = data); } - // END - await Task.WhenAll(endTasks); - _loaded = true; StateHasChanged(); } @@ -119,7 +121,7 @@ public partial class MainLayout : LayoutComponentBase if (!string.IsNullOrWhiteSpace(_searchbarText)) { string query = WebUtility.UrlEncode(_searchbarText); - NavigationManager.NavigateTo($"/search/{query}"); + NavigationManager.NavigateTo($"/search/{query}", true); } } diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs index 3817611..b8993a8 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Components; using WatchIt.Website.Layout; -using WatchIt.Website.Services.Utility.Authentication; +using WatchIt.Website.Services.Authentication; namespace WatchIt.Website.Pages; diff --git a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.css deleted file mode 100644 index 5f28270..0000000 --- a/WatchIt.Website/WatchIt.Website/Pages/AdminPage.razor.css +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/AuthPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/AuthPage.razor.cs index d646264..05f6be9 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/AuthPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/AuthPage.razor.cs @@ -3,11 +3,11 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Accounts; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Photos; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Accounts; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Photos; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Tokens; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Photos; namespace WatchIt.Website.Pages; @@ -18,9 +18,9 @@ public partial class AuthPage [Inject] public ILogger Logger { get; set; } = default!; [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; [Inject] public ITokensService TokensService { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IAccountsWebAPIService AccountsWebAPIService { get; set; } = default!; - [Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!; + [Inject] public IMediaClientService MediaClientService { get; set; } = default!; + [Inject] public IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] public IPhotosClientService PhotosClientService { get; set; } = default!; [Inject] public NavigationManager NavigationManager { get; set; } = default!; #endregion @@ -80,7 +80,7 @@ public partial class AuthPage // STEP 0 endTasks.AddRange( [ - PhotosWebAPIService.GetPhotoRandomBackground(data => _background = data) + PhotosClientService.GetPhotoRandomBackground(data => _background = data) ]); // END @@ -112,7 +112,7 @@ public partial class AuthPage } - await AccountsWebAPIService.Authenticate(_loginModel, async (data) => await LoginSuccess(data), LoginBadRequest, LoginUnauthorized); + await AccountsClientService.Authenticate(_loginModel, async (data) => await LoginSuccess(data), LoginBadRequest, LoginUnauthorized); } private async Task Register() @@ -137,7 +137,7 @@ public partial class AuthPage _formMessage = "Password fields don't match"; return; } - await AccountsWebAPIService.Register(_registerModel, RegisterSuccess, RegisterBadRequest); + await AccountsClientService.Register(_registerModel, RegisterSuccess, RegisterBadRequest); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor index 5740ae8..c5e6630 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor @@ -3,6 +3,7 @@ @using WatchIt.Common.Model.Series @using WatchIt.Website.Components.Pages.DatabasePage @using WatchIt.Website.Components.Pages.DatabasePage.Subcomponents +@using WatchIt.Website.Components.Common.ListComponent @page "/database/{type?}" @@ -30,78 +31,78 @@ @switch (Type) { case "movies": - + - + break; case "series": - + - + break; case "people": - + - + break; } \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs index 179454a..48ae59b 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.cs @@ -1,9 +1,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Website.Layout; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website.Pages; @@ -12,10 +12,10 @@ public partial class DatabasePage : ComponentBase #region SERVICES [Inject] private NavigationManager NavigationManager { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; - [Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IMoviesClientService MoviesClientService { get; set; } = default!; + [Inject] private ISeriesClientService SeriesClientService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; #endregion diff --git a/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/DatabasePage.razor.css deleted file mode 100644 index e69de29..0000000 diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor index f967910..459cd3c 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor @@ -1,7 +1,6 @@ @using WatchIt.Common.Model.Movies @using WatchIt.Common.Model.Persons @using WatchIt.Common.Model.Series -@using WatchIt.Website.Components.Pages.HomePage.Panels @page "/" @@ -10,28 +9,28 @@
- - - + + +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs index abed50c..b623573 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.cs @@ -3,10 +3,10 @@ using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Movies; using WatchIt.Common.Model.Series; using WatchIt.Website.Layout; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website.Pages; @@ -15,10 +15,10 @@ public partial class HomePage #region SERVICES [Inject] public NavigationManager NavigationManager { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; - [Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; - [Inject] public IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] public IMediaClientService MediaClientService { get; set; } = default!; + [Inject] public IMoviesClientService MoviesClientService { get; set; } = default!; + [Inject] public ISeriesClientService SeriesClientService { get; set; } = default!; + [Inject] public IPersonsClientService PersonsClientService { get; set; } = default!; #endregion diff --git a/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/HomePage.razor.css deleted file mode 100644 index e69de29..0000000 diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor index 58a4ef7..f0aa505 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor @@ -51,16 +51,27 @@
-

@(_media is not null ? "Edit" : "Create new") @(_movieRequest is not null ? "movie" : "series")@(_media is not null ? $" \"{_media.Title}\"" : string.Empty)

+
+ @if (_media is not null) + { + +

Edit @(_movieRequest is not null ? "movie" : "series") "@(_media.Title)"

+
+ } + else + { +

Create new @(_movieRequest is not null ? "movie" : "series")

+ } +
diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs index d0dc6f5..ad6d54f 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaEditPage.razor.cs @@ -7,12 +7,12 @@ using WatchIt.Common.Model.Persons; using WatchIt.Common.Model.Photos; using WatchIt.Common.Model.Series; using WatchIt.Website.Layout; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Photos; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Photos; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website.Pages; @@ -22,11 +22,11 @@ public partial class MediaEditPage : ComponentBase [Inject] public NavigationManager NavigationManager { get; set; } = default!; [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; - [Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; - [Inject] public IPhotosWebAPIService PhotosWebAPIService { get; set; } = default!; - [Inject] public IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] public IMediaClientService MediaClientService { get; set; } = default!; + [Inject] public IMoviesClientService MoviesClientService { get; set; } = default!; + [Inject] public ISeriesClientService SeriesClientService { get; set; } = default!; + [Inject] public IPhotosClientService PhotosClientService { get; set; } = default!; + [Inject] public IPersonsClientService PersonsClientService { get; set; } = default!; #endregion @@ -114,7 +114,7 @@ public partial class MediaEditPage : ComponentBase ]); endTasks.AddRange( [ - PersonsWebAPIService.GetAllPersons(successAction: data => _persons = data.ToDictionary(x => x.Id, x => x)) + PersonsClientService.GetAllPersons(successAction: data => _persons = data.ToDictionary(x => x.Id, x => x)) ]); } @@ -124,13 +124,13 @@ public partial class MediaEditPage : ComponentBase { endTasks.AddRange( [ - MediaWebAPIService.GetMediaPhotoRandomBackground(Id.Value, data => Layout.BackgroundPhoto = data), - MediaWebAPIService.GetMediaPoster(Id.Value, data => + MediaClientService.GetMediaPhotoRandomBackground(Id.Value, data => Layout.BackgroundPhoto = data), + MediaClientService.GetMediaPoster(Id.Value, data => { _mediaPosterSaved = data; _mediaPosterRequest = new MediaPosterRequest(data); }), - MediaWebAPIService.GetMediaPhotos(Id.Value, successAction: data => _photos = data) + MediaClientService.GetMediaPhotos(Id.Value, successAction: data => _photos = data) ]); } @@ -145,14 +145,14 @@ public partial class MediaEditPage : ComponentBase { if (Id.HasValue) { - await MediaWebAPIService.GetMedia(Id.Value, data => _media = data, () => NavigationManager.NavigateTo("/media/new/movie")); + await MediaClientService.GetMedia(Id.Value, data => _media = data, () => NavigationManager.NavigateTo("/media/new/movie")); if (_media.Type == MediaType.Movie) { - await MoviesWebAPIService.GetMovie(Id.Value, data => _movieRequest = new MovieRequest(data)); + await MoviesClientService.GetMovie(Id.Value, data => _movieRequest = new MovieRequest(data)); } else { - await SeriesWebAPIService.GetSeries(Id.Value, data => _seriesRequest = new SeriesRequest(data)); + await SeriesClientService.GetSeries(Id.Value, data => _seriesRequest = new SeriesRequest(data)); } } else @@ -210,7 +210,7 @@ public partial class MediaEditPage : ComponentBase } _mediaPosterSaving = true; - await MediaWebAPIService.PutMediaPoster(Id.Value, _mediaPosterRequest, Success); + await MediaClientService.PutMediaPoster(Id.Value, _mediaPosterRequest, Success); } private void CancelPoster() @@ -230,7 +230,7 @@ public partial class MediaEditPage : ComponentBase } _mediaPosterDeleting = true; - await MediaWebAPIService.DeleteMediaPoster(Id.Value, Success); + await MediaClientService.DeleteMediaPoster(Id.Value, Success); } #endregion @@ -259,22 +259,22 @@ public partial class MediaEditPage : ComponentBase { if (_movieRequest is not null) { - await MoviesWebAPIService.PostMovie(_movieRequest, data => SuccessPost(data.Id), BadRequest); + await MoviesClientService.PostMovie(_movieRequest, data => SuccessPost(data.Id), BadRequest); } else { - await SeriesWebAPIService.PostSeries(_seriesRequest, data => SuccessPost(data.Id), BadRequest); + await SeriesClientService.PostSeries(_seriesRequest, data => SuccessPost(data.Id), BadRequest); } } else { if (_movieRequest is not null) { - await MoviesWebAPIService.PutMovie(Id.Value, _movieRequest, () => _basicDataSaving = false, BadRequest); + await MoviesClientService.PutMovie(Id.Value, _movieRequest, () => _basicDataSaving = false, BadRequest); } else { - await SeriesWebAPIService.PutSeries(Id.Value, _seriesRequest, () => _basicDataSaving = false, BadRequest); + await SeriesClientService.PutSeries(Id.Value, _seriesRequest, () => _basicDataSaving = false, BadRequest); } } } @@ -291,7 +291,7 @@ public partial class MediaEditPage : ComponentBase } _photoDeleting.Add(id); - await PhotosWebAPIService.DeletePhoto(id, async () => await Success()); + await PhotosClientService.DeletePhoto(id, async () => await Success()); } private void InitEditPhoto(Guid? id) @@ -345,17 +345,17 @@ public partial class MediaEditPage : ComponentBase if (_photoEditId is null) { _photoEditRequest.Background = _photoEditIsBackground ? _photoEditBackgroundData : null; - await MediaWebAPIService.PostMediaPhoto(Id.Value, _photoEditRequest, Success, BadRequest); + await MediaClientService.PostMediaPhoto(Id.Value, _photoEditRequest, Success, BadRequest); } else { if (_photoEditIsBackground) { - await PhotosWebAPIService.PutPhotoBackgroundData(_photoEditId.Value, _photoEditBackgroundData, Success, BadRequest); + await PhotosClientService.PutPhotoBackgroundData(_photoEditId.Value, _photoEditBackgroundData, Success, BadRequest); } else { - await PhotosWebAPIService.DeletePhotoBackgroundData(_photoEditId.Value, Success); + await PhotosClientService.DeletePhotoBackgroundData(_photoEditId.Value, Success); } } } diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor index 2dde4a8..87b0359 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor @@ -36,7 +36,7 @@ else Subname="@(_media.OriginalTitle)" Description="@(_media.Description)" PosterPlaceholder="/assets/media_poster.png" - GetPosterMethod="@(action => MediaWebAPIService.GetMediaPoster(_media.Id, action))"/> + GetPosterMethod="@(action => MediaClientService.GetMediaPoster(_media.Id, action))"/>
@@ -169,7 +169,7 @@ else + Class="panel panel-menu panel-background-menu justify-content-center"> Actors Creators diff --git a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs index e3321c9..047716f 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/MediaPage.razor.cs @@ -7,10 +7,10 @@ using WatchIt.Common.Model.Photos; using WatchIt.Common.Model.Rating; using WatchIt.Common.Model.Series; using WatchIt.Website.Layout; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website.Pages; @@ -20,9 +20,9 @@ public partial class MediaPage : ComponentBase [Inject] public NavigationManager NavigationManager { get; set; } = default!; [Inject] public IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] public IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] public IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; - [Inject] public ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; + [Inject] public IMediaClientService MediaClientService { get; set; } = default!; + [Inject] public IMoviesClientService MoviesClientService { get; set; } = default!; + [Inject] public ISeriesClientService SeriesClientService { get; set; } = default!; #endregion @@ -74,7 +74,7 @@ public partial class MediaPage : ComponentBase // STEP 0 step1Tasks.AddRange( [ - MediaWebAPIService.GetMedia(Id, data => _media = data, () => _error = $"Media with id {Id} was not found") + MediaClientService.GetMedia(Id, data => _media = data, () => _error = $"Media with id {Id} was not found") ]); // STEP 1 @@ -88,11 +88,11 @@ public partial class MediaPage : ComponentBase endTasks.AddRange( [ - MediaWebAPIService.PostMediaView(Id), - MediaWebAPIService.GetMediaPhotoRandomBackground(Id, data => Layout.BackgroundPhoto = data), - MediaWebAPIService.GetMediaGenres(Id, data => _genres = data), - MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data), - _media.Type == MediaType.Movie ? MoviesWebAPIService.GetMovie(Id, data => _movie = data) : SeriesWebAPIService.GetSeries(Id, data => _series = data), + MediaClientService.PostMediaView(Id), + MediaClientService.GetMediaPhotoRandomBackground(Id, data => Layout.BackgroundPhoto = data), + MediaClientService.GetMediaGenres(Id, data => _genres = data), + MediaClientService.GetMediaRating(Id, data => _globalRating = data), + _media.Type == MediaType.Movie ? MoviesClientService.GetMovie(Id, data => _movie = data) : SeriesClientService.GetSeries(Id, data => _series = data), ]); } @@ -102,7 +102,7 @@ public partial class MediaPage : ComponentBase { endTasks.AddRange( [ - MediaWebAPIService.GetMediaRatingByUser(Id, _user.Id, data => _userRating = data) + MediaClientService.GetMediaRatingByUser(Id, _user.Id, data => _userRating = data) ]); } @@ -118,15 +118,15 @@ public partial class MediaPage : ComponentBase { if (_userRating == rating) { - await MediaWebAPIService.DeleteMediaRating(Id); + await MediaClientService.DeleteMediaRating(Id); _userRating = null; } else { - await MediaWebAPIService.PutMediaRating(Id, new RatingRequest(rating)); + await MediaClientService.PutMediaRating(Id, new RatingRequest(rating)); _userRating = rating; } - await MediaWebAPIService.GetMediaRating(Id, data => _globalRating = data); + await MediaClientService.GetMediaRating(Id, data => _globalRating = data); } #endregion diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor index 4e557d3..466d05d 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor @@ -49,9 +49,9 @@
diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs index 242d128..77bd731 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.cs @@ -2,9 +2,9 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Media; using WatchIt.Common.Model.Persons; using WatchIt.Website.Layout; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Persons; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; namespace WatchIt.Website.Pages; @@ -14,8 +14,8 @@ public partial class PersonEditPage : ComponentBase [Inject] private NavigationManager NavigationManager { get; set; } = default!; [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; #endregion @@ -66,8 +66,8 @@ public partial class PersonEditPage : ComponentBase { endTasks.AddRange( [ - PersonsWebAPIService.GetPerson(Id.Value, data => _person = data, () => NavigationManager.NavigateTo("/person/new", true)), - MediaWebAPIService.GetAllMedia(successAction: data => _media = data.ToDictionary(x => x.Id, x => x)), + PersonsClientService.GetPerson(Id.Value, data => _person = data, () => NavigationManager.NavigateTo("/person/new", true)), + MediaClientService.GetAllMedia(successAction: data => _media = data.ToDictionary(x => x.Id, x => x)), ]); } diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/PersonEditPage.razor.css deleted file mode 100644 index e69de29..0000000 diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor b/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor index d88eb16..bbd303c 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor @@ -26,7 +26,7 @@ Subname="@(_person.FullName)" Description="@(_person.Description)" PosterPlaceholder="/assets/person_poster.png" - GetPosterMethod="@(action => PersonsWebAPIService.GetPersonPhoto(_person.Id, action))"/> + GetPosterMethod="@(action => PersonsClientService.GetPersonPhoto(_person.Id, action))"/>
@@ -44,7 +44,7 @@ + Class="panel panel-menu panel-background-menu justify-content-center"> Actor Creator diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.cs index 12120a1..29307ce 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.cs @@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Components; using WatchIt.Common.Model.Persons; using WatchIt.Website.Components.Pages.PersonPage.Panels; using WatchIt.Website.Layout; -using WatchIt.Website.Services.WebAPI.Persons; +using WatchIt.Website.Services.Client.Persons; namespace WatchIt.Website.Pages; @@ -10,7 +10,7 @@ public partial class PersonPage : ComponentBase { #region SERVICES - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; #endregion @@ -53,7 +53,7 @@ public partial class PersonPage : ComponentBase // STEP 0 step1Tasks.AddRange( [ - PersonsWebAPIService.GetPerson(Id, data => _person = data) + PersonsClientService.GetPerson(Id, data => _person = data) ]); // STEP 1 @@ -62,7 +62,7 @@ public partial class PersonPage : ComponentBase { endTasks.AddRange( [ - PersonsWebAPIService.PostPersonView(Id), + PersonsClientService.PostPersonView(Id), ]); } diff --git a/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/PersonPage.razor.css deleted file mode 100644 index e69de29..0000000 diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor index a88e28e..afcbd75 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor +++ b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor @@ -1,3 +1,4 @@ +@using System.Net @using WatchIt.Common.Model.Movies @using WatchIt.Common.Model.Persons @using WatchIt.Common.Model.Series @@ -15,7 +16,7 @@

- Search results for phrase: "@(DecodedQuery)" + Search results for phrase: "@(WebUtility.UrlDecode(Query))"

@@ -27,14 +28,14 @@ NameSource="@(item => item.Title)" AdditionalNameInfoSource="@(item => item.ReleaseDate.HasValue ? $" ({item.ReleaseDate.Value.Year})" : null)" RatingSource="@(item => item.Rating)" - Query="@(new MovieQueryParameters { Title = DecodedQuery, OrderBy = "rating.count" })" - ItemDownloadingTask="@(MoviesWebAPIService.GetAllMovies)" - PictureDownloadingTask="@((id, action) => MediaWebAPIService.GetMediaPoster(id, action))" + Query="@(new MovieQueryParameters { Title = WebUtility.UrlDecode(Query), OrderBy = "rating.count" })" + ItemDownloadingTask="@(MoviesClientService.GetAllMovies)" + PictureDownloadingTask="@((id, action) => MediaClientService.GetMediaPoster(id, action))" PosterPlaceholder="/assets/media_poster.png" - GetGlobalRatingMethod="@((id, action) => MediaWebAPIService.GetMediaRating(id, action))" - GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaWebAPIService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))" - PutRatingMethod="@((id, request) => MediaWebAPIService.PutMediaRating(id, request))" - DeleteRatingMethod="@(id => MediaWebAPIService.DeleteMediaRating(id))"/> + GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))" + GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))" + PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))" + DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))"/> + GetGlobalRatingMethod="@((id, action) => MediaClientService.GetMediaRating(id, action))" + GetUserRatingMethod="@((id, userId, successAction, notfoundAction) => MediaClientService.GetMediaRatingByUser(id, userId, successAction, notfoundAction))" + PutRatingMethod="@((id, request) => MediaClientService.PutMediaRating(id, request))" + DeleteRatingMethod="@(id => MediaClientService.DeleteMediaRating(id))"/> + GetGlobalRatingMethod="@((id, action) => PersonsClientService.GetPersonGlobalRating(id, action))"/> +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs index 029a402..baaef95 100644 --- a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs +++ b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.cs @@ -1,10 +1,10 @@ using System.Net; using Microsoft.AspNetCore.Components; using WatchIt.Website.Layout; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website.Pages; @@ -12,10 +12,10 @@ public partial class SearchPage : ComponentBase { #region SERVICES - [Inject] private IMoviesWebAPIService MoviesWebAPIService { get; set; } = default!; - [Inject] private ISeriesWebAPIService SeriesWebAPIService { get; set; } = default!; - [Inject] private IMediaWebAPIService MediaWebAPIService { get; set; } = default!; - [Inject] private IPersonsWebAPIService PersonsWebAPIService { get; set; } = default!; + [Inject] private IMoviesClientService MoviesClientService { get; set; } = default!; + [Inject] private ISeriesClientService SeriesClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; #endregion diff --git a/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.css b/WatchIt.Website/WatchIt.Website/Pages/SearchPage.razor.css deleted file mode 100644 index e69de29..0000000 diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor new file mode 100644 index 0000000..1ef2c1b --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor @@ -0,0 +1,93 @@ +@using System.Text +@using WatchIt.Common.Model +@using WatchIt.Common.Model.Photos +@using WatchIt.Website.Components.Pages.UserEditPage.Panels + + +@page "/user/edit" + +@{ + StringBuilder sb = new StringBuilder(" - WatchIt"); + + if (_accountData is null) sb.Insert(0, "Loading..."); + else sb.Insert(0, "User settings"); + + @(sb.ToString()) +} + + + +
+ @if (_accountData is not null) + { +
+
+ +
+
+
+
+ + + Profile + Account + + + +
+
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+ + + + +
+
+
+
+
+
+ } + else + { +
+
+
+ +
+
+
+ } +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs new file mode 100644 index 0000000..cb179b4 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/UserEditPage.razor.cs @@ -0,0 +1,80 @@ +using System.Net; +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model; +using WatchIt.Common.Model.Accounts; +using WatchIt.Common.Model.Photos; +using WatchIt.Website.Components.Pages.UserEditPage.Panels; +using WatchIt.Website.Layout; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; + +namespace WatchIt.Website.Pages; + +public partial class UserEditPage : ComponentBase +{ + #region SERVICES + + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [CascadingParameter] public MainLayout Layout { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private AccountResponse? _accountData; + + private UserEditPageHeaderPanelComponent _header = default!; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + Layout.BackgroundPhoto = null; + + User? user = await AuthenticationService.GetUserAsync(); + if (user is null) + { + NavigationManager.NavigateTo($"/auth?redirect_to={WebUtility.UrlEncode("/user/edit")}"); + return; + } + StateHasChanged(); + + await Task.WhenAll( + [ + AccountsClientService.GetAccount(user.Id, data => _accountData = data), + AccountsClientService.GetAccountProfileBackground(user.Id, data => Layout.BackgroundPhoto = data) + ]); + StateHasChanged(); + } + } + + private async Task PictureChanged() => await Task.WhenAll( + [ + _header.ReloadPicture(), + Layout.ReloadProfilePicture() + ]); + + private void BackgroundChanged(PhotoResponse? background) + { + Layout.BackgroundPhoto = background; + } + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor new file mode 100644 index 0000000..722e501 --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor @@ -0,0 +1,184 @@ +@using System.Text +@using WatchIt.Common.Model.Movies +@using WatchIt.Common.Model.Persons +@using WatchIt.Common.Model.Series +@using WatchIt.Website.Components.Pages.UserPage.Panels +@using WatchIt.Website.Components.Common.ListComponent +@using WatchIt.Website.Components.Pages.UserPage.Subcomponents +@using WatchIt.Website.Services.Client.Persons + +@page "/user/{id:long?}" + +@{ + StringBuilder sb = new StringBuilder(" - WatchIt"); + + if (!_loaded) sb.Insert(0, "Loading..."); + else if (_accountData is null) sb.Insert(0, "Error"); + else + { + if (_owner) sb.Insert(0, "Your profile"); + else sb.Insert(0, $"\"{_accountData.Username}\" profile"); + } + + @(sb.ToString()) +} + + + +
+ @if (!_loaded) + { +
+
+
+ +
+
+
+ } + else if (_accountData is null) + { +
+
+ +
+
+ } + else + { +
+
+ +
+
+
+
+ + + Summary + Movies + TV Series + People + + + +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+ +
+ + + +
+
+
+
+
+
+ } +
\ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs new file mode 100644 index 0000000..41cec0a --- /dev/null +++ b/WatchIt.Website/WatchIt.Website/Pages/UserPage.razor.cs @@ -0,0 +1,100 @@ +using System.Net; +using Microsoft.AspNetCore.Components; +using WatchIt.Common.Model.Accounts; +using WatchIt.Website.Layout; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Persons; + +namespace WatchIt.Website.Pages; + +public partial class UserPage : ComponentBase +{ + #region SERVICES + + [Inject] private NavigationManager NavigationManager { get; set; } = default!; + [Inject] private IAuthenticationService AuthenticationService { get; set; } = default!; + [Inject] private IAccountsClientService AccountsClientService { get; set; } = default!; + [Inject] private IMediaClientService MediaClientService { get; set; } = default!; + [Inject] private IPersonsClientService PersonsClientService { get; set; } = default!; + + #endregion + + + + #region PARAMETERS + + [Parameter] public long? Id { get; set; } + + [CascadingParameter] public MainLayout Layout { get; set; } = default!; + + #endregion + + + + #region FIELDS + + private bool _loaded; + private bool _redirection; + private bool _owner; + private AccountResponse? _accountData; + + #endregion + + + + #region PRIVATE METHODS + + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + List step1Tasks = new List(); + List endTasks = new List(); + + // INIT + Layout.BackgroundPhoto = null; + + // STEP 0 + step1Tasks.AddRange( + [ + GetUserData() + ]); + + // STEP 1 + await Task.WhenAll(step1Tasks); + endTasks.AddRange( + [ + AccountsClientService.GetAccountProfileBackground(_accountData.Id, data => Layout.BackgroundPhoto = data) + ]); + + // END + await Task.WhenAll(endTasks); + + _loaded = !_redirection; + StateHasChanged(); + } + } + + private async Task GetUserData() + { + User? user = await AuthenticationService.GetUserAsync(); + if (!Id.HasValue) + { + if (user is null) + { + NavigationManager.NavigateTo($"/auth?redirect_to={WebUtility.UrlEncode("/user")}"); + _redirection = true; + return; + } + Id = user.Id; + } + + await AccountsClientService.GetAccount(Id.Value, data => _accountData = data); + _owner = Id.Value == user?.Id; + } + + + #endregion +} \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/Program.cs b/WatchIt.Website/WatchIt.Website/Program.cs index 9f05d6f..fe0c437 100644 --- a/WatchIt.Website/WatchIt.Website/Program.cs +++ b/WatchIt.Website/WatchIt.Website/Program.cs @@ -5,17 +5,17 @@ using Blazorise.Bootstrap5; using Blazorise.Icons.FontAwesome; using Microsoft.AspNetCore.Components.Authorization; using WatchIt.Common.Services.HttpClient; -using WatchIt.Website.Services.Utility.Authentication; -using WatchIt.Website.Services.Utility.Configuration; -using WatchIt.Website.Services.Utility.Tokens; -using WatchIt.Website.Services.WebAPI.Accounts; -using WatchIt.Website.Services.WebAPI.Genders; -using WatchIt.Website.Services.WebAPI.Media; -using WatchIt.Website.Services.WebAPI.Movies; -using WatchIt.Website.Services.WebAPI.Persons; -using WatchIt.Website.Services.WebAPI.Photos; -using WatchIt.Website.Services.WebAPI.Roles; -using WatchIt.Website.Services.WebAPI.Series; +using WatchIt.Website.Services.Authentication; +using WatchIt.Website.Services.Configuration; +using WatchIt.Website.Services.Tokens; +using WatchIt.Website.Services.Client.Accounts; +using WatchIt.Website.Services.Client.Genders; +using WatchIt.Website.Services.Client.Media; +using WatchIt.Website.Services.Client.Movies; +using WatchIt.Website.Services.Client.Persons; +using WatchIt.Website.Services.Client.Photos; +using WatchIt.Website.Services.Client.Roles; +using WatchIt.Website.Services.Client.Series; namespace WatchIt.Website; @@ -73,14 +73,14 @@ public static class Program builder.Services.AddScoped(); // WebAPI - builder.Services.AddScoped(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); - builder.Services.AddSingleton(); + builder.Services.AddScoped(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); + builder.Services.AddSingleton(); return builder; } diff --git a/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj b/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj index 9601cf7..d473aa5 100644 --- a/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj +++ b/WatchIt.Website/WatchIt.Website/WatchIt.Website.csproj @@ -16,17 +16,8 @@ - - - - - - - - - - - + + diff --git a/WatchIt.Website/WatchIt.Website/_Imports.razor b/WatchIt.Website/WatchIt.Website/_Imports.razor index e95dbc3..a1fd28e 100644 --- a/WatchIt.Website/WatchIt.Website/_Imports.razor +++ b/WatchIt.Website/WatchIt.Website/_Imports.razor @@ -12,9 +12,9 @@ @using WatchIt.Website.Components.Common.Panels @using WatchIt.Common.Model.Accounts @using WatchIt.Common.Model.Media -@using WatchIt.Website.Services.Utility.Tokens -@using WatchIt.Website.Services.Utility.Authentication -@using WatchIt.Website.Services.WebAPI.Accounts -@using WatchIt.Website.Services.WebAPI.Media +@using WatchIt.Website.Services.Tokens +@using WatchIt.Website.Services.Authentication +@using WatchIt.Website.Services.Client.Accounts +@using WatchIt.Website.Services.Client.Media @using Blazorise @using Blazorise.Bootstrap5 \ No newline at end of file diff --git a/WatchIt.Website/WatchIt.Website/appsettings.json b/WatchIt.Website/WatchIt.Website/appsettings.json index 2e65e00..9f2429a 100644 --- a/WatchIt.Website/WatchIt.Website/appsettings.json +++ b/WatchIt.Website/WatchIt.Website/appsettings.json @@ -19,9 +19,23 @@ "Base": "/accounts", "Register": "/register", "Authenticate": "/authenticate", - "AuthenticateRefresh": "/authenticate-refresh", + "AuthenticateRefresh": "/authenticate_refresh", "Logout": "/logout", - "GetProfilePicture": "/{0}/profile-picture" + "GetAccountProfilePicture": "/{0}/profile_picture", + "PutAccountProfilePicture": "/profile_picture", + "DeleteAccountProfilePicture": "/profile_picture", + "GetAccountProfileBackground": "/{0}/profile_background", + "PutAccountProfileBackground": "/profile_background", + "DeleteAccountProfileBackground": "/profile_background", + "GetAccounts": "", + "GetAccount": "/{0}", + "PutAccountProfileInfo": "/profile_info", + "PatchAccountUsername": "/username", + "PatchAccountEmail": "/email", + "PatchAccountPassword": "/password", + "GetAccountRatedMovies": "/{0}/movies", + "GetAccountRatedSeries": "/{0}/series", + "GetAccountRatedPersons": "/{0}/persons" }, "Genders": { "Base": "/genders", diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/css/gaps.css b/WatchIt.Website/WatchIt.Website/wwwroot/css/gaps.css index 3b45259..a89f191 100644 --- a/WatchIt.Website/WatchIt.Website/wwwroot/css/gaps.css +++ b/WatchIt.Website/WatchIt.Website/wwwroot/css/gaps.css @@ -1,5 +1,9 @@ /* DEFAULT */ +.mt-header { + margin-top: 9rem !important; +} + .mt-default { margin-top: 1rem !important; } diff --git a/WatchIt.Website/WatchIt.Website/wwwroot/css/panel.css b/WatchIt.Website/WatchIt.Website/wwwroot/css/panel.css index 0e200f3..6dcb155 100644 --- a/WatchIt.Website/WatchIt.Website/wwwroot/css/panel.css +++ b/WatchIt.Website/WatchIt.Website/wwwroot/css/panel.css @@ -28,7 +28,7 @@ gap: 1rem; padding: 1rem 1.5rem !important; - background-color: rgba(0, 0, 0, 0.8); + background-color: rgba(0, 0, 0, 0.7); } .panel-menu > li > a { @@ -52,6 +52,14 @@ +/* SECTION HEADER */ + +.panel-section-header { + padding: 0.75rem 1.5rem; +} + + + /* BACKGROUNDS */ .panel-background-gold { diff --git a/WatchIt.sln b/WatchIt.sln index 70d247e..99c5e6d 100644 --- a/WatchIt.sln +++ b/WatchIt.sln @@ -1,310 +1,241 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website", "WatchIt.Website", "{4CB91BF6-87F1-4088-A943-62548CD1F9F4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Common", "WatchIt.Common", "{0EDF709C-99F4-3EE5-9136-4C92A768A3F8}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Database", "WatchIt.Database", "{15BAFF8D-02CA-4B6D-BB81-E0AA135FEDAF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Model", "WatchIt.Common\WatchIt.Common.Model\WatchIt.Common.Model.csproj", "{F9E593F3-49A5-3F24-D468-932375E9971D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI", "WatchIt.WebAPI", "{301EEE5B-B54C-491F-ADDA-58E3F4448684}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Query", "WatchIt.Common\WatchIt.Common.Query\WatchIt.Common.Query.csproj", "{5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database", "WatchIt.Database\WatchIt.Database\WatchIt.Database.csproj", "{23383776-1F27-4B5D-8C7C-57BFF75FA473}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Common.Services", "WatchIt.Common.Services", "{DC2B5349-B77C-59FD-0E4D-E6749FACB96D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.WorkerServices", "WatchIt.WebAPI\WatchIt.WebAPI.WorkerServices\WatchIt.WebAPI.WorkerServices.csproj", "{0EAD71FB-ED04-4054-9071-61A14FC89B27}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Services.HttpClient", "WatchIt.Common\WatchIt.Common.Services\WatchIt.Common.Services.HttpClient\WatchIt.Common.Services.HttpClient.csproj", "{BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI", "WatchIt.WebAPI\WatchIt.WebAPI\WatchIt.WebAPI.csproj", "{E8907CA7-18D5-4DB0-AEAB-911B85DDA63D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Database", "WatchIt.Database", "{227CC20A-F08E-180E-2EE3-ADA5DB2A8891}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Database.Model", "WatchIt.Database.Model", "{2BCB1F43-033A-4CED-A88C-4126B7CAE107}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database", "WatchIt.Database\WatchIt.Database\WatchIt.Database.csproj", "{B045DE15-B896-BB0E-3D0A-F2B55D2704FF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model\WatchIt.Database.Model.csproj", "{23F6E4EC-3105-4E94-905B-E6939C528224}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Database.Model", "WatchIt.Database.Model", "{90A007E0-353E-9587-79F1-149A51AEA943}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model.Configuration", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model.Configuration\WatchIt.Database.Model.Configuration.csproj", "{698BD418-94F5-4500-80B8-79B1955C9C9F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model.Configuration", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model.Configuration\WatchIt.Database.Model.Configuration.csproj", "{C046FE28-DA43-139C-BA9E-289844A7CC9A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model.Seeding", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model.Seeding\WatchIt.Database.Model.Seeding.csproj", "{11470B68-F26D-4F15-90CC-25B11A1A36AB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model.Seeding", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model.Seeding\WatchIt.Database.Model.Seeding.csproj", "{3E2F07F5-838A-6141-5B48-D879F2B645E0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Controllers", "WatchIt.WebAPI\WatchIt.WebAPI.Controllers\WatchIt.WebAPI.Controllers.csproj", "{B5EA38DF-F396-44DF-80EE-7639EDBEF8BC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Database.Model", "WatchIt.Database\WatchIt.Database.Model\WatchIt.Database.Model\WatchIt.Database.Model.csproj", "{8B33B44E-0245-511C-C2AD-D47E6153670D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Validators", "WatchIt.WebAPI\WatchIt.WebAPI.Validators\WatchIt.WebAPI.Validators.csproj", "{C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI", "WatchIt.WebAPI", "{580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services", "WatchIt.WebAPI.Services", "{9A652B6B-EF78-4029-91A4-AD48168CBF2B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Controllers", "WatchIt.WebAPI\WatchIt.WebAPI.Controllers\WatchIt.WebAPI.Controllers.csproj", "{1E179F33-2D2F-752B-4AE6-5C72B29B4123}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services.Controllers", "WatchIt.WebAPI.Services.Controllers", "{CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Validators", "WatchIt.WebAPI\WatchIt.WebAPI.Validators\WatchIt.WebAPI.Validators.csproj", "{AD58457B-9326-03B8-5831-ED515464503A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Common", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Common\WatchIt.WebAPI.Services.Controllers.Common.csproj", "{A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.WorkerServices", "WatchIt.WebAPI\WatchIt.WebAPI.WorkerServices\WatchIt.WebAPI.WorkerServices.csproj", "{0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Common", "WatchIt.Common", "{E98C42C1-26E5-4939-8C22-72C253DE874B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI", "WatchIt.WebAPI\WatchIt.WebAPI\WatchIt.WebAPI.csproj", "{935F490B-5A14-87EA-A6F7-C808E8233619}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Model", "WatchIt.Common\WatchIt.Common.Model\WatchIt.Common.Model.csproj", "{C7FF493E-C2E4-4498-8212-D4CBD8C234B9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services", "WatchIt.WebAPI.Services", "{57D9D146-511A-42D7-C1C5-0D18D3E1ADAF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Accounts", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Accounts\WatchIt.WebAPI.Services.Controllers.Accounts.csproj", "{BB1ACEB6-6834-44D0-8382-DE4E3B297632}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services.Controllers", "WatchIt.WebAPI.Services.Controllers", "{8D8C51C4-760C-9908-3CE3-2A00341BA9B3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services.Utility", "WatchIt.WebAPI.Services.Utility", "{BD014A3C-E574-4ADF-A2E4-9B2D754A854D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Accounts", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Accounts\WatchIt.WebAPI.Services.Controllers.Accounts.csproj", "{3C42534E-57D6-1270-FD53-1F85E7D1B136}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.Tokens", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Tokens\WatchIt.WebAPI.Services.Utility.Tokens.csproj", "{261C0D38-4D5C-4775-9BF9-819FE30D6ECB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Common", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Common\WatchIt.WebAPI.Services.Controllers.Common.csproj", "{5D9EB880-7F26-85D2-0606-FFBA669CA8FB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.Configuration", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Configuration\WatchIt.WebAPI.Services.Utility.Configuration.csproj", "{3B5A06E2-6A5A-4BBF-944D-0E08141A94DA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Genders", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Genders\WatchIt.WebAPI.Services.Controllers.Genders.csproj", "{195DE0A1-20F2-DE84-330E-64EF72C116A1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.User", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.User\WatchIt.WebAPI.Services.Utility.User.csproj", "{55777911-8032-4607-B533-12941A52019F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Genres", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Genres\WatchIt.WebAPI.Services.Controllers.Genres.csproj", "{B400518F-D1EE-66BF-31C8-033E502F04C2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Genres", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Genres\WatchIt.WebAPI.Services.Controllers.Genres.csproj", "{2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Media", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Media\WatchIt.WebAPI.Services.Controllers.Media.csproj", "{F5813724-3299-71CB-B219-1133BFB3CE49}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website", "WatchIt.Website\WatchIt.Website\WatchIt.Website.csproj", "{46CE78A1-3EC3-4112-AAAD-26EEB8D8B194}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Movies", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Movies\WatchIt.WebAPI.Services.Controllers.Movies.csproj", "{CE807E91-B0E6-0E34-4842-4BCD74C15A71}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Movies", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Movies\WatchIt.WebAPI.Services.Controllers.Movies.csproj", "{69BB6A9E-B673-42AB-A516-6B2513E21FDC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Persons", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj", "{F4521C82-C834-1392-313E-A23DD3C91379}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website.Services", "WatchIt.Website.Services", "{A82972D0-9A60-4B3F-AE46-9F304D79137F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Photos", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Photos\WatchIt.WebAPI.Services.Controllers.Photos.csproj", "{3103A43A-694B-46B4-904D-84FCBAB3DDBE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website.Services.WebAPI", "WatchIt.Website.Services.WebAPI", "{46E3711F-18BD-4004-AF53-EA4D8643D92F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Roles", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Roles\WatchIt.WebAPI.Services.Controllers.Roles.csproj", "{F6AAC506-626B-A519-AAA9-DED4C1511B7D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Accounts", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Accounts\WatchIt.Website.Services.WebAPI.Accounts.csproj", "{68B7E892-9074-4034-8AFC-2474D7D5BE29}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Series", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Series\WatchIt.WebAPI.Services.Controllers.Series.csproj", "{5FB4B0AA-09A7-11A8-D45F-73946CBDF400}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Genres", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Genres\WatchIt.Website.Services.WebAPI.Genres.csproj", "{A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.WebAPI.Services.Utility", "WatchIt.WebAPI.Services.Utility", "{0D7F6705-9114-1C0D-61F6-E76D43BBFD95}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Movies", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Movies\WatchIt.Website.Services.WebAPI.Movies.csproj", "{539404EB-BDFD-46F8-8F21-6A231ABED9B1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.Configuration", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Configuration\WatchIt.WebAPI.Services.Utility.Configuration.csproj", "{654F560F-B171-9B66-30C2-FA728CB812E1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website.Services.Utility", "WatchIt.Website.Services.Utility", "{130BC8F5-82CE-4EDF-AECB-21594DD41849}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.Tokens", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.Tokens\WatchIt.WebAPI.Services.Utility.Tokens.csproj", "{115E0CB8-501B-F73A-B4E5-343DC9C0FC93}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Common.Services", "WatchIt.Common.Services", "{882A9795-4AC0-4556-9750-6582B2701EFA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Utility.User", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Utility\WatchIt.WebAPI.Services.Utility.User\WatchIt.WebAPI.Services.Utility.User.csproj", "{872394DD-5F95-2FD2-E30D-7E2B021F055B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Query", "WatchIt.Common\WatchIt.Common.Query\WatchIt.Common.Query.csproj", "{6C3AE7B4-18C5-42D3-B254-460027E50143}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website", "WatchIt.Website", "{A476FF40-6AD9-F237-094D-BC9CD170091F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Common.Services.HttpClient", "WatchIt.Common\WatchIt.Common.Services\WatchIt.Common.Services.HttpClient\WatchIt.Common.Services.HttpClient.csproj", "{A4A75CCA-0DEE-4F1E-9816-60674CA807FA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website", "WatchIt.Website\WatchIt.Website\WatchIt.Website.csproj", "{53AB0957-9473-8422-8FB2-2611339FAACC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Utility.Configuration", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Configuration\WatchIt.Website.Services.Utility.Configuration.csproj", "{0DBBE7EA-05FE-481F-8814-6FA0BC9E571F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WatchIt.Website.Services", "WatchIt.Website.Services", "{AE403159-2725-6961-6E01-1CB0FBD8C1DF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Media", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Media\WatchIt.WebAPI.Services.Controllers.Media.csproj", "{3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Authentication", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Authentication\WatchIt.Website.Services.Authentication.csproj", "{27B65069-12AD-68A4-238F-58FA84F24813}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Media", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Media\WatchIt.Website.Services.WebAPI.Media.csproj", "{1D64B7B5-650D-4AF3-AC33-A8D1F0999906}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Client", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Client\WatchIt.Website.Services.Client.csproj", "{F176F958-3A95-DDBC-8036-2B7E49B3254E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Common", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Common\WatchIt.Website.Services.WebAPI.Common.csproj", "{2D62ED42-489E-4888-9479-E5A50A0E7D70}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Configuration", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Configuration\WatchIt.Website.Services.Configuration.csproj", "{979B1DA2-CEA0-95C6-3E85-9329D28A41D1}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Utility.Tokens", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Tokens\WatchIt.Website.Services.Utility.Tokens.csproj", "{77FDAFDD-E97E-4059-A935-B563B6B0D555}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Utility.Authentication", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Utility\WatchIt.Website.Services.Utility.Authentication\WatchIt.Website.Services.Utility.Authentication.csproj", "{8720AECA-7084-429A-BA15-49B6622C1A32}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Series", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Series\WatchIt.WebAPI.Services.Controllers.Series.csproj", "{F8FCEF7B-72EA-48BC-AC68-E11244B067DD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Series", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Series\WatchIt.Website.Services.WebAPI.Series.csproj", "{783C743A-85BF-4382-BFE5-7A90E3F3B8B6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Photos", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Photos\WatchIt.WebAPI.Services.Controllers.Photos.csproj", "{ABDF8471-2FAB-4930-B016-7DD3E48AE6B8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Photos", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Photos\WatchIt.Website.Services.WebAPI.Photos.csproj", "{960A833F-C195-4D1D-AD4F-D00B57067181}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Persons", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Persons\WatchIt.WebAPI.Services.Controllers.Persons.csproj", "{335686F5-65B8-4D66-AAA8-C5032906451D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Persons", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Persons\WatchIt.Website.Services.WebAPI.Persons.csproj", "{83D42D72-FF67-4577-8280-2ABD5B20F985}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Genders", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Genders\WatchIt.WebAPI.Services.Controllers.Genders.csproj", "{13BE36AB-2120-4F1B-815A-6F5E3F589EE8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Genders", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Genders\WatchIt.Website.Services.WebAPI.Genders.csproj", "{B74144DE-EF62-430A-AB80-5D185DD03C05}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.WebAPI.Services.Controllers.Roles", "WatchIt.WebAPI\WatchIt.WebAPI.Services\WatchIt.WebAPI.Services.Controllers\WatchIt.WebAPI.Services.Controllers.Roles\WatchIt.WebAPI.Services.Controllers.Roles.csproj", "{847D157A-E486-4FB6-9AA3-43931A60FB5F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.WebAPI.Roles", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.WebAPI\WatchIt.Website.Services.WebAPI.Roles\WatchIt.Website.Services.WebAPI.Roles.csproj", "{3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchIt.Website.Services.Tokens", "WatchIt.Website\WatchIt.Website.Services\WatchIt.Website.Services.Tokens\WatchIt.Website.Services.Tokens.csproj", "{95A0DC72-B175-3174-5EE2-F1E3473DE428}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {23383776-1F27-4B5D-8C7C-57BFF75FA473} = {15BAFF8D-02CA-4B6D-BB81-E0AA135FEDAF} - {0EAD71FB-ED04-4054-9071-61A14FC89B27} = {301EEE5B-B54C-491F-ADDA-58E3F4448684} - {E8907CA7-18D5-4DB0-AEAB-911B85DDA63D} = {301EEE5B-B54C-491F-ADDA-58E3F4448684} - {2BCB1F43-033A-4CED-A88C-4126B7CAE107} = {15BAFF8D-02CA-4B6D-BB81-E0AA135FEDAF} - {23F6E4EC-3105-4E94-905B-E6939C528224} = {2BCB1F43-033A-4CED-A88C-4126B7CAE107} - {698BD418-94F5-4500-80B8-79B1955C9C9F} = {2BCB1F43-033A-4CED-A88C-4126B7CAE107} - {11470B68-F26D-4F15-90CC-25B11A1A36AB} = {2BCB1F43-033A-4CED-A88C-4126B7CAE107} - {B5EA38DF-F396-44DF-80EE-7639EDBEF8BC} = {301EEE5B-B54C-491F-ADDA-58E3F4448684} - {C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E} = {301EEE5B-B54C-491F-ADDA-58E3F4448684} - {9A652B6B-EF78-4029-91A4-AD48168CBF2B} = {301EEE5B-B54C-491F-ADDA-58E3F4448684} - {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} = {9A652B6B-EF78-4029-91A4-AD48168CBF2B} - {A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {C7FF493E-C2E4-4498-8212-D4CBD8C234B9} = {E98C42C1-26E5-4939-8C22-72C253DE874B} - {BB1ACEB6-6834-44D0-8382-DE4E3B297632} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {BD014A3C-E574-4ADF-A2E4-9B2D754A854D} = {9A652B6B-EF78-4029-91A4-AD48168CBF2B} - {261C0D38-4D5C-4775-9BF9-819FE30D6ECB} = {BD014A3C-E574-4ADF-A2E4-9B2D754A854D} - {3B5A06E2-6A5A-4BBF-944D-0E08141A94DA} = {BD014A3C-E574-4ADF-A2E4-9B2D754A854D} - {55777911-8032-4607-B533-12941A52019F} = {BD014A3C-E574-4ADF-A2E4-9B2D754A854D} - {2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {46CE78A1-3EC3-4112-AAAD-26EEB8D8B194} = {4CB91BF6-87F1-4088-A943-62548CD1F9F4} - {69BB6A9E-B673-42AB-A516-6B2513E21FDC} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {A82972D0-9A60-4B3F-AE46-9F304D79137F} = {4CB91BF6-87F1-4088-A943-62548CD1F9F4} - {46E3711F-18BD-4004-AF53-EA4D8643D92F} = {A82972D0-9A60-4B3F-AE46-9F304D79137F} - {68B7E892-9074-4034-8AFC-2474D7D5BE29} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {539404EB-BDFD-46F8-8F21-6A231ABED9B1} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {130BC8F5-82CE-4EDF-AECB-21594DD41849} = {A82972D0-9A60-4B3F-AE46-9F304D79137F} - {882A9795-4AC0-4556-9750-6582B2701EFA} = {E98C42C1-26E5-4939-8C22-72C253DE874B} - {6C3AE7B4-18C5-42D3-B254-460027E50143} = {E98C42C1-26E5-4939-8C22-72C253DE874B} - {A4A75CCA-0DEE-4F1E-9816-60674CA807FA} = {882A9795-4AC0-4556-9750-6582B2701EFA} - {0DBBE7EA-05FE-481F-8814-6FA0BC9E571F} = {130BC8F5-82CE-4EDF-AECB-21594DD41849} - {3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {1D64B7B5-650D-4AF3-AC33-A8D1F0999906} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {2D62ED42-489E-4888-9479-E5A50A0E7D70} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {77FDAFDD-E97E-4059-A935-B563B6B0D555} = {130BC8F5-82CE-4EDF-AECB-21594DD41849} - {8720AECA-7084-429A-BA15-49B6622C1A32} = {130BC8F5-82CE-4EDF-AECB-21594DD41849} - {F8FCEF7B-72EA-48BC-AC68-E11244B067DD} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {783C743A-85BF-4382-BFE5-7A90E3F3B8B6} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {ABDF8471-2FAB-4930-B016-7DD3E48AE6B8} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {960A833F-C195-4D1D-AD4F-D00B57067181} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {335686F5-65B8-4D66-AAA8-C5032906451D} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {83D42D72-FF67-4577-8280-2ABD5B20F985} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {13BE36AB-2120-4F1B-815A-6F5E3F589EE8} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {B74144DE-EF62-430A-AB80-5D185DD03C05} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - {847D157A-E486-4FB6-9AA3-43931A60FB5F} = {CEC468DB-CC49-47D3-9E3E-1CC9530C3CE7} - {3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82} = {46E3711F-18BD-4004-AF53-EA4D8643D92F} - EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {23383776-1F27-4B5D-8C7C-57BFF75FA473}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23383776-1F27-4B5D-8C7C-57BFF75FA473}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23383776-1F27-4B5D-8C7C-57BFF75FA473}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23383776-1F27-4B5D-8C7C-57BFF75FA473}.Release|Any CPU.Build.0 = Release|Any CPU - {0EAD71FB-ED04-4054-9071-61A14FC89B27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EAD71FB-ED04-4054-9071-61A14FC89B27}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EAD71FB-ED04-4054-9071-61A14FC89B27}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EAD71FB-ED04-4054-9071-61A14FC89B27}.Release|Any CPU.Build.0 = Release|Any CPU - {E8907CA7-18D5-4DB0-AEAB-911B85DDA63D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8907CA7-18D5-4DB0-AEAB-911B85DDA63D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8907CA7-18D5-4DB0-AEAB-911B85DDA63D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8907CA7-18D5-4DB0-AEAB-911B85DDA63D}.Release|Any CPU.Build.0 = Release|Any CPU - {23F6E4EC-3105-4E94-905B-E6939C528224}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23F6E4EC-3105-4E94-905B-E6939C528224}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23F6E4EC-3105-4E94-905B-E6939C528224}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23F6E4EC-3105-4E94-905B-E6939C528224}.Release|Any CPU.Build.0 = Release|Any CPU - {698BD418-94F5-4500-80B8-79B1955C9C9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {698BD418-94F5-4500-80B8-79B1955C9C9F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {698BD418-94F5-4500-80B8-79B1955C9C9F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {698BD418-94F5-4500-80B8-79B1955C9C9F}.Release|Any CPU.Build.0 = Release|Any CPU - {11470B68-F26D-4F15-90CC-25B11A1A36AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11470B68-F26D-4F15-90CC-25B11A1A36AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11470B68-F26D-4F15-90CC-25B11A1A36AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11470B68-F26D-4F15-90CC-25B11A1A36AB}.Release|Any CPU.Build.0 = Release|Any CPU - {B5EA38DF-F396-44DF-80EE-7639EDBEF8BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5EA38DF-F396-44DF-80EE-7639EDBEF8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5EA38DF-F396-44DF-80EE-7639EDBEF8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5EA38DF-F396-44DF-80EE-7639EDBEF8BC}.Release|Any CPU.Build.0 = Release|Any CPU - {C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C05705D7-6E53-4BF1-840F-BC5FAB7C1C4E}.Release|Any CPU.Build.0 = Release|Any CPU - {A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A0AA9F70-44A6-49DA-ACC4-ACF0E2F16316}.Release|Any CPU.Build.0 = Release|Any CPU - {C7FF493E-C2E4-4498-8212-D4CBD8C234B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7FF493E-C2E4-4498-8212-D4CBD8C234B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7FF493E-C2E4-4498-8212-D4CBD8C234B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7FF493E-C2E4-4498-8212-D4CBD8C234B9}.Release|Any CPU.Build.0 = Release|Any CPU - {BB1ACEB6-6834-44D0-8382-DE4E3B297632}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB1ACEB6-6834-44D0-8382-DE4E3B297632}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB1ACEB6-6834-44D0-8382-DE4E3B297632}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB1ACEB6-6834-44D0-8382-DE4E3B297632}.Release|Any CPU.Build.0 = Release|Any CPU - {261C0D38-4D5C-4775-9BF9-819FE30D6ECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {261C0D38-4D5C-4775-9BF9-819FE30D6ECB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {261C0D38-4D5C-4775-9BF9-819FE30D6ECB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {261C0D38-4D5C-4775-9BF9-819FE30D6ECB}.Release|Any CPU.Build.0 = Release|Any CPU - {3B5A06E2-6A5A-4BBF-944D-0E08141A94DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B5A06E2-6A5A-4BBF-944D-0E08141A94DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B5A06E2-6A5A-4BBF-944D-0E08141A94DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B5A06E2-6A5A-4BBF-944D-0E08141A94DA}.Release|Any CPU.Build.0 = Release|Any CPU - {55777911-8032-4607-B533-12941A52019F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55777911-8032-4607-B533-12941A52019F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55777911-8032-4607-B533-12941A52019F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55777911-8032-4607-B533-12941A52019F}.Release|Any CPU.Build.0 = Release|Any CPU - {2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2EC6FD28-C580-45FA-B6A7-92A6BF0CCC54}.Release|Any CPU.Build.0 = Release|Any CPU - {46CE78A1-3EC3-4112-AAAD-26EEB8D8B194}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46CE78A1-3EC3-4112-AAAD-26EEB8D8B194}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46CE78A1-3EC3-4112-AAAD-26EEB8D8B194}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46CE78A1-3EC3-4112-AAAD-26EEB8D8B194}.Release|Any CPU.Build.0 = Release|Any CPU - {69BB6A9E-B673-42AB-A516-6B2513E21FDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69BB6A9E-B673-42AB-A516-6B2513E21FDC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69BB6A9E-B673-42AB-A516-6B2513E21FDC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69BB6A9E-B673-42AB-A516-6B2513E21FDC}.Release|Any CPU.Build.0 = Release|Any CPU - {68B7E892-9074-4034-8AFC-2474D7D5BE29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68B7E892-9074-4034-8AFC-2474D7D5BE29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68B7E892-9074-4034-8AFC-2474D7D5BE29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68B7E892-9074-4034-8AFC-2474D7D5BE29}.Release|Any CPU.Build.0 = Release|Any CPU - {A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A98D06A6-9C95-4449-9F4E-1D31BBE1D9B1}.Release|Any CPU.Build.0 = Release|Any CPU - {539404EB-BDFD-46F8-8F21-6A231ABED9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {539404EB-BDFD-46F8-8F21-6A231ABED9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {539404EB-BDFD-46F8-8F21-6A231ABED9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {539404EB-BDFD-46F8-8F21-6A231ABED9B1}.Release|Any CPU.Build.0 = Release|Any CPU - {6C3AE7B4-18C5-42D3-B254-460027E50143}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C3AE7B4-18C5-42D3-B254-460027E50143}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C3AE7B4-18C5-42D3-B254-460027E50143}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C3AE7B4-18C5-42D3-B254-460027E50143}.Release|Any CPU.Build.0 = Release|Any CPU - {A4A75CCA-0DEE-4F1E-9816-60674CA807FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4A75CCA-0DEE-4F1E-9816-60674CA807FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4A75CCA-0DEE-4F1E-9816-60674CA807FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4A75CCA-0DEE-4F1E-9816-60674CA807FA}.Release|Any CPU.Build.0 = Release|Any CPU - {0DBBE7EA-05FE-481F-8814-6FA0BC9E571F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DBBE7EA-05FE-481F-8814-6FA0BC9E571F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DBBE7EA-05FE-481F-8814-6FA0BC9E571F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DBBE7EA-05FE-481F-8814-6FA0BC9E571F}.Release|Any CPU.Build.0 = Release|Any CPU - {3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3156AD7B-D6EC-4EB6-AEE8-4FBAF14C18E4}.Release|Any CPU.Build.0 = Release|Any CPU - {1D64B7B5-650D-4AF3-AC33-A8D1F0999906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D64B7B5-650D-4AF3-AC33-A8D1F0999906}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D64B7B5-650D-4AF3-AC33-A8D1F0999906}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D64B7B5-650D-4AF3-AC33-A8D1F0999906}.Release|Any CPU.Build.0 = Release|Any CPU - {2D62ED42-489E-4888-9479-E5A50A0E7D70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D62ED42-489E-4888-9479-E5A50A0E7D70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D62ED42-489E-4888-9479-E5A50A0E7D70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D62ED42-489E-4888-9479-E5A50A0E7D70}.Release|Any CPU.Build.0 = Release|Any CPU - {77FDAFDD-E97E-4059-A935-B563B6B0D555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77FDAFDD-E97E-4059-A935-B563B6B0D555}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77FDAFDD-E97E-4059-A935-B563B6B0D555}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77FDAFDD-E97E-4059-A935-B563B6B0D555}.Release|Any CPU.Build.0 = Release|Any CPU - {8720AECA-7084-429A-BA15-49B6622C1A32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8720AECA-7084-429A-BA15-49B6622C1A32}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8720AECA-7084-429A-BA15-49B6622C1A32}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8720AECA-7084-429A-BA15-49B6622C1A32}.Release|Any CPU.Build.0 = Release|Any CPU - {F8FCEF7B-72EA-48BC-AC68-E11244B067DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8FCEF7B-72EA-48BC-AC68-E11244B067DD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8FCEF7B-72EA-48BC-AC68-E11244B067DD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8FCEF7B-72EA-48BC-AC68-E11244B067DD}.Release|Any CPU.Build.0 = Release|Any CPU - {783C743A-85BF-4382-BFE5-7A90E3F3B8B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {783C743A-85BF-4382-BFE5-7A90E3F3B8B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {783C743A-85BF-4382-BFE5-7A90E3F3B8B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {783C743A-85BF-4382-BFE5-7A90E3F3B8B6}.Release|Any CPU.Build.0 = Release|Any CPU - {ABDF8471-2FAB-4930-B016-7DD3E48AE6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABDF8471-2FAB-4930-B016-7DD3E48AE6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABDF8471-2FAB-4930-B016-7DD3E48AE6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABDF8471-2FAB-4930-B016-7DD3E48AE6B8}.Release|Any CPU.Build.0 = Release|Any CPU - {960A833F-C195-4D1D-AD4F-D00B57067181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {960A833F-C195-4D1D-AD4F-D00B57067181}.Debug|Any CPU.Build.0 = Debug|Any CPU - {960A833F-C195-4D1D-AD4F-D00B57067181}.Release|Any CPU.ActiveCfg = Release|Any CPU - {960A833F-C195-4D1D-AD4F-D00B57067181}.Release|Any CPU.Build.0 = Release|Any CPU - {335686F5-65B8-4D66-AAA8-C5032906451D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {335686F5-65B8-4D66-AAA8-C5032906451D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {335686F5-65B8-4D66-AAA8-C5032906451D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {335686F5-65B8-4D66-AAA8-C5032906451D}.Release|Any CPU.Build.0 = Release|Any CPU - {83D42D72-FF67-4577-8280-2ABD5B20F985}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83D42D72-FF67-4577-8280-2ABD5B20F985}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83D42D72-FF67-4577-8280-2ABD5B20F985}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83D42D72-FF67-4577-8280-2ABD5B20F985}.Release|Any CPU.Build.0 = Release|Any CPU - {13BE36AB-2120-4F1B-815A-6F5E3F589EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13BE36AB-2120-4F1B-815A-6F5E3F589EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13BE36AB-2120-4F1B-815A-6F5E3F589EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13BE36AB-2120-4F1B-815A-6F5E3F589EE8}.Release|Any CPU.Build.0 = Release|Any CPU - {B74144DE-EF62-430A-AB80-5D185DD03C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B74144DE-EF62-430A-AB80-5D185DD03C05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B74144DE-EF62-430A-AB80-5D185DD03C05}.Release|Any CPU.Build.0 = Release|Any CPU - {847D157A-E486-4FB6-9AA3-43931A60FB5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {847D157A-E486-4FB6-9AA3-43931A60FB5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {847D157A-E486-4FB6-9AA3-43931A60FB5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {847D157A-E486-4FB6-9AA3-43931A60FB5F}.Release|Any CPU.Build.0 = Release|Any CPU - {3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3D8B7909-BAC2-42FD-8A72-D1DADDB3BC82}.Release|Any CPU.Build.0 = Release|Any CPU + {F9E593F3-49A5-3F24-D468-932375E9971D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9E593F3-49A5-3F24-D468-932375E9971D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9E593F3-49A5-3F24-D468-932375E9971D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9E593F3-49A5-3F24-D468-932375E9971D}.Release|Any CPU.Build.0 = Release|Any CPU + {5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27}.Release|Any CPU.Build.0 = Release|Any CPU + {BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84}.Release|Any CPU.Build.0 = Release|Any CPU + {B045DE15-B896-BB0E-3D0A-F2B55D2704FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B045DE15-B896-BB0E-3D0A-F2B55D2704FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B045DE15-B896-BB0E-3D0A-F2B55D2704FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B045DE15-B896-BB0E-3D0A-F2B55D2704FF}.Release|Any CPU.Build.0 = Release|Any CPU + {C046FE28-DA43-139C-BA9E-289844A7CC9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C046FE28-DA43-139C-BA9E-289844A7CC9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C046FE28-DA43-139C-BA9E-289844A7CC9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C046FE28-DA43-139C-BA9E-289844A7CC9A}.Release|Any CPU.Build.0 = Release|Any CPU + {3E2F07F5-838A-6141-5B48-D879F2B645E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E2F07F5-838A-6141-5B48-D879F2B645E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E2F07F5-838A-6141-5B48-D879F2B645E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E2F07F5-838A-6141-5B48-D879F2B645E0}.Release|Any CPU.Build.0 = Release|Any CPU + {8B33B44E-0245-511C-C2AD-D47E6153670D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B33B44E-0245-511C-C2AD-D47E6153670D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B33B44E-0245-511C-C2AD-D47E6153670D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B33B44E-0245-511C-C2AD-D47E6153670D}.Release|Any CPU.Build.0 = Release|Any CPU + {1E179F33-2D2F-752B-4AE6-5C72B29B4123}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E179F33-2D2F-752B-4AE6-5C72B29B4123}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E179F33-2D2F-752B-4AE6-5C72B29B4123}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E179F33-2D2F-752B-4AE6-5C72B29B4123}.Release|Any CPU.Build.0 = Release|Any CPU + {AD58457B-9326-03B8-5831-ED515464503A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AD58457B-9326-03B8-5831-ED515464503A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AD58457B-9326-03B8-5831-ED515464503A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AD58457B-9326-03B8-5831-ED515464503A}.Release|Any CPU.Build.0 = Release|Any CPU + {0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C}.Release|Any CPU.Build.0 = Release|Any CPU + {935F490B-5A14-87EA-A6F7-C808E8233619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {935F490B-5A14-87EA-A6F7-C808E8233619}.Debug|Any CPU.Build.0 = Debug|Any CPU + {935F490B-5A14-87EA-A6F7-C808E8233619}.Release|Any CPU.ActiveCfg = Release|Any CPU + {935F490B-5A14-87EA-A6F7-C808E8233619}.Release|Any CPU.Build.0 = Release|Any CPU + {3C42534E-57D6-1270-FD53-1F85E7D1B136}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C42534E-57D6-1270-FD53-1F85E7D1B136}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C42534E-57D6-1270-FD53-1F85E7D1B136}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C42534E-57D6-1270-FD53-1F85E7D1B136}.Release|Any CPU.Build.0 = Release|Any CPU + {5D9EB880-7F26-85D2-0606-FFBA669CA8FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D9EB880-7F26-85D2-0606-FFBA669CA8FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D9EB880-7F26-85D2-0606-FFBA669CA8FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D9EB880-7F26-85D2-0606-FFBA669CA8FB}.Release|Any CPU.Build.0 = Release|Any CPU + {195DE0A1-20F2-DE84-330E-64EF72C116A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {195DE0A1-20F2-DE84-330E-64EF72C116A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {195DE0A1-20F2-DE84-330E-64EF72C116A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {195DE0A1-20F2-DE84-330E-64EF72C116A1}.Release|Any CPU.Build.0 = Release|Any CPU + {B400518F-D1EE-66BF-31C8-033E502F04C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B400518F-D1EE-66BF-31C8-033E502F04C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B400518F-D1EE-66BF-31C8-033E502F04C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B400518F-D1EE-66BF-31C8-033E502F04C2}.Release|Any CPU.Build.0 = Release|Any CPU + {F5813724-3299-71CB-B219-1133BFB3CE49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5813724-3299-71CB-B219-1133BFB3CE49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5813724-3299-71CB-B219-1133BFB3CE49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5813724-3299-71CB-B219-1133BFB3CE49}.Release|Any CPU.Build.0 = Release|Any CPU + {CE807E91-B0E6-0E34-4842-4BCD74C15A71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE807E91-B0E6-0E34-4842-4BCD74C15A71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE807E91-B0E6-0E34-4842-4BCD74C15A71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE807E91-B0E6-0E34-4842-4BCD74C15A71}.Release|Any CPU.Build.0 = Release|Any CPU + {F4521C82-C834-1392-313E-A23DD3C91379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F4521C82-C834-1392-313E-A23DD3C91379}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F4521C82-C834-1392-313E-A23DD3C91379}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F4521C82-C834-1392-313E-A23DD3C91379}.Release|Any CPU.Build.0 = Release|Any CPU + {3103A43A-694B-46B4-904D-84FCBAB3DDBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3103A43A-694B-46B4-904D-84FCBAB3DDBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3103A43A-694B-46B4-904D-84FCBAB3DDBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3103A43A-694B-46B4-904D-84FCBAB3DDBE}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AAC506-626B-A519-AAA9-DED4C1511B7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AAC506-626B-A519-AAA9-DED4C1511B7D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AAC506-626B-A519-AAA9-DED4C1511B7D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AAC506-626B-A519-AAA9-DED4C1511B7D}.Release|Any CPU.Build.0 = Release|Any CPU + {5FB4B0AA-09A7-11A8-D45F-73946CBDF400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FB4B0AA-09A7-11A8-D45F-73946CBDF400}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FB4B0AA-09A7-11A8-D45F-73946CBDF400}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FB4B0AA-09A7-11A8-D45F-73946CBDF400}.Release|Any CPU.Build.0 = Release|Any CPU + {654F560F-B171-9B66-30C2-FA728CB812E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {654F560F-B171-9B66-30C2-FA728CB812E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {654F560F-B171-9B66-30C2-FA728CB812E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {654F560F-B171-9B66-30C2-FA728CB812E1}.Release|Any CPU.Build.0 = Release|Any CPU + {115E0CB8-501B-F73A-B4E5-343DC9C0FC93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {115E0CB8-501B-F73A-B4E5-343DC9C0FC93}.Debug|Any CPU.Build.0 = Debug|Any CPU + {115E0CB8-501B-F73A-B4E5-343DC9C0FC93}.Release|Any CPU.ActiveCfg = Release|Any CPU + {115E0CB8-501B-F73A-B4E5-343DC9C0FC93}.Release|Any CPU.Build.0 = Release|Any CPU + {872394DD-5F95-2FD2-E30D-7E2B021F055B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {872394DD-5F95-2FD2-E30D-7E2B021F055B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {872394DD-5F95-2FD2-E30D-7E2B021F055B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {872394DD-5F95-2FD2-E30D-7E2B021F055B}.Release|Any CPU.Build.0 = Release|Any CPU + {53AB0957-9473-8422-8FB2-2611339FAACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53AB0957-9473-8422-8FB2-2611339FAACC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53AB0957-9473-8422-8FB2-2611339FAACC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53AB0957-9473-8422-8FB2-2611339FAACC}.Release|Any CPU.Build.0 = Release|Any CPU + {27B65069-12AD-68A4-238F-58FA84F24813}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27B65069-12AD-68A4-238F-58FA84F24813}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27B65069-12AD-68A4-238F-58FA84F24813}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27B65069-12AD-68A4-238F-58FA84F24813}.Release|Any CPU.Build.0 = Release|Any CPU + {F176F958-3A95-DDBC-8036-2B7E49B3254E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F176F958-3A95-DDBC-8036-2B7E49B3254E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F176F958-3A95-DDBC-8036-2B7E49B3254E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F176F958-3A95-DDBC-8036-2B7E49B3254E}.Release|Any CPU.Build.0 = Release|Any CPU + {979B1DA2-CEA0-95C6-3E85-9329D28A41D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {979B1DA2-CEA0-95C6-3E85-9329D28A41D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {979B1DA2-CEA0-95C6-3E85-9329D28A41D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {979B1DA2-CEA0-95C6-3E85-9329D28A41D1}.Release|Any CPU.Build.0 = Release|Any CPU + {95A0DC72-B175-3174-5EE2-F1E3473DE428}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95A0DC72-B175-3174-5EE2-F1E3473DE428}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95A0DC72-B175-3174-5EE2-F1E3473DE428}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95A0DC72-B175-3174-5EE2-F1E3473DE428}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {F9E593F3-49A5-3F24-D468-932375E9971D} = {0EDF709C-99F4-3EE5-9136-4C92A768A3F8} + {5E9025E1-41C3-A27B-99BE-5AAB5CF7EE27} = {0EDF709C-99F4-3EE5-9136-4C92A768A3F8} + {DC2B5349-B77C-59FD-0E4D-E6749FACB96D} = {0EDF709C-99F4-3EE5-9136-4C92A768A3F8} + {BCD06E73-4DF3-68A2-1A5A-F4870D5AEF84} = {DC2B5349-B77C-59FD-0E4D-E6749FACB96D} + {B045DE15-B896-BB0E-3D0A-F2B55D2704FF} = {227CC20A-F08E-180E-2EE3-ADA5DB2A8891} + {90A007E0-353E-9587-79F1-149A51AEA943} = {227CC20A-F08E-180E-2EE3-ADA5DB2A8891} + {C046FE28-DA43-139C-BA9E-289844A7CC9A} = {90A007E0-353E-9587-79F1-149A51AEA943} + {3E2F07F5-838A-6141-5B48-D879F2B645E0} = {90A007E0-353E-9587-79F1-149A51AEA943} + {8B33B44E-0245-511C-C2AD-D47E6153670D} = {90A007E0-353E-9587-79F1-149A51AEA943} + {1E179F33-2D2F-752B-4AE6-5C72B29B4123} = {580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3} + {AD58457B-9326-03B8-5831-ED515464503A} = {580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3} + {0F30275E-5CE6-D2A6-4D2C-01B0ECF8EC3C} = {580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3} + {935F490B-5A14-87EA-A6F7-C808E8233619} = {580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3} + {57D9D146-511A-42D7-C1C5-0D18D3E1ADAF} = {580BCC26-D6F3-27C7-CD4B-4CDBB56CF3A3} + {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} = {57D9D146-511A-42D7-C1C5-0D18D3E1ADAF} + {0D7F6705-9114-1C0D-61F6-E76D43BBFD95} = {57D9D146-511A-42D7-C1C5-0D18D3E1ADAF} + {3C42534E-57D6-1270-FD53-1F85E7D1B136} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {5D9EB880-7F26-85D2-0606-FFBA669CA8FB} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {195DE0A1-20F2-DE84-330E-64EF72C116A1} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {B400518F-D1EE-66BF-31C8-033E502F04C2} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {F5813724-3299-71CB-B219-1133BFB3CE49} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {CE807E91-B0E6-0E34-4842-4BCD74C15A71} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {F4521C82-C834-1392-313E-A23DD3C91379} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {3103A43A-694B-46B4-904D-84FCBAB3DDBE} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {F6AAC506-626B-A519-AAA9-DED4C1511B7D} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {5FB4B0AA-09A7-11A8-D45F-73946CBDF400} = {8D8C51C4-760C-9908-3CE3-2A00341BA9B3} + {654F560F-B171-9B66-30C2-FA728CB812E1} = {0D7F6705-9114-1C0D-61F6-E76D43BBFD95} + {115E0CB8-501B-F73A-B4E5-343DC9C0FC93} = {0D7F6705-9114-1C0D-61F6-E76D43BBFD95} + {872394DD-5F95-2FD2-E30D-7E2B021F055B} = {0D7F6705-9114-1C0D-61F6-E76D43BBFD95} + {53AB0957-9473-8422-8FB2-2611339FAACC} = {A476FF40-6AD9-F237-094D-BC9CD170091F} + {AE403159-2725-6961-6E01-1CB0FBD8C1DF} = {A476FF40-6AD9-F237-094D-BC9CD170091F} + {27B65069-12AD-68A4-238F-58FA84F24813} = {AE403159-2725-6961-6E01-1CB0FBD8C1DF} + {F176F958-3A95-DDBC-8036-2B7E49B3254E} = {AE403159-2725-6961-6E01-1CB0FBD8C1DF} + {979B1DA2-CEA0-95C6-3E85-9329D28A41D1} = {AE403159-2725-6961-6E01-1CB0FBD8C1DF} + {95A0DC72-B175-3174-5EE2-F1E3473DE428} = {AE403159-2725-6961-6E01-1CB0FBD8C1DF} EndGlobalSection EndGlobal