This commit is contained in:
2023-02-18 08:52:17 +01:00
parent 8a7d4ac906
commit 9719a0c0fd
137 changed files with 19057 additions and 0 deletions

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace SocialPub.ClientModels.User.Avatar
{
[JsonSerializable(typeof(InsertAvatarForm))]
public class InsertAvatarForm
{
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace SocialPub.ClientModels.User.Avatar
{
[JsonSerializable(typeof(UpdateAvatarForm))]
public class UpdateAvatarForm
{
}
}

View File

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace SocialPub.ClientModels.User.Avatar
{
[JsonSerializable(typeof(UpdateAvatarSettings))]
public class UpdateAvatarSettings
{
}
}

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace SocialPub.ClientModels.User.Avatar
{
[JsonSerializable(typeof(ViewAvatar))]
public class ViewAvatar
{
public ViewAvatarSettings Settings { get; set; }
}
}

View File

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SocialPub.ClientModels.User.Avatar
{
public class ViewAvatarSettings
{
}
}

View File

@ -0,0 +1,13 @@
namespace SocialPub.ClientModels.User
{
public class JwtUser
{
public string UserId { get; set; }
public string Username { get; set; }
public string Email { get; set; }
public List<string> Policies { get; set; } = new();
public string Token { get; set; }
public long Expiration { get; set; }
public ViewUserSettings UserSettings { get; set; } = new();
}
}

View File

@ -0,0 +1,40 @@
using SocialPub.ClientModels.Resources;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
namespace SocialPub.ClientModels.User
{
public class UserForm
{
[EmailAddress(ErrorMessageResourceName = "InvalidEmail", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = "Email", ResourceType = typeof(FieldsNameResource))]
public string Email { get; set; }
}
public class UserPasswordForm
{
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
PasswordPropertyText(true),
Display(Name = "OldPassword", ResourceType = typeof(FieldsNameResource)),
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
public string OldPassword { get; set; }
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
PasswordPropertyText(true),
Display(Name = "NewPassword", ResourceType = typeof(FieldsNameResource)),
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
public string NewPassword { get; set; }
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
PasswordPropertyText(true),
Compare(nameof(NewPassword), ErrorMessageResourceName = "ComparePasswords", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = "NewPasswordConfirmation", ResourceType = typeof(FieldsNameResource))]
public string RepeatedPassword { get; set; }
}
}

View File

@ -0,0 +1,7 @@
namespace SocialPub.ClientModels.User
{
public class UsersIds
{
public IList<string> UserIdList { get; set; } = Array.Empty<string>();
}
}

View File

@ -0,0 +1,25 @@
using SocialPub.ClientModels.Resources;
using System.ComponentModel.DataAnnotations;
namespace SocialPub.ClientModels.User
{
public class ViewUserSettings
{
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = nameof(LanguageCode), ResourceType = typeof(FieldsNameResource))]
public string LanguageCode { get; set; } = "en";
[Range(0, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
public short LightThemeIndexColour { get; set; } = 25;
[Range(0, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
public short DarkThemeIndexColour { get; set; } = 215;
[Range(-2, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
public short IconsThemeIndexColour { get; set; } = 25;
public bool PreferSystemTheming { get; set; } = false;
public bool ThemeIsDarkMode { get; set; } = false;
public bool ThemeIsLightGray { get; set; } = false;
public bool ThemeIsDarkGray { get; set; } = false;
}
}