Init
This commit is contained in:
14
SocialPub.ClientModels/User/Avatar/InsertAvatarForm.cs
Normal file
14
SocialPub.ClientModels/User/Avatar/InsertAvatarForm.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
14
SocialPub.ClientModels/User/Avatar/UpdateAvatarForm.cs
Normal file
14
SocialPub.ClientModels/User/Avatar/UpdateAvatarForm.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
14
SocialPub.ClientModels/User/Avatar/UpdateAvatarSettings.cs
Normal file
14
SocialPub.ClientModels/User/Avatar/UpdateAvatarSettings.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
16
SocialPub.ClientModels/User/Avatar/ViewAvatar.cs
Normal file
16
SocialPub.ClientModels/User/Avatar/ViewAvatar.cs
Normal 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; }
|
||||
}
|
||||
}
|
12
SocialPub.ClientModels/User/Avatar/ViewAvatarSettings.cs
Normal file
12
SocialPub.ClientModels/User/Avatar/ViewAvatarSettings.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
13
SocialPub.ClientModels/User/JwtUser.cs
Normal file
13
SocialPub.ClientModels/User/JwtUser.cs
Normal 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();
|
||||
}
|
||||
}
|
40
SocialPub.ClientModels/User/UserForm.cs
Normal file
40
SocialPub.ClientModels/User/UserForm.cs
Normal 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; }
|
||||
}
|
||||
}
|
7
SocialPub.ClientModels/User/UsersIds.cs
Normal file
7
SocialPub.ClientModels/User/UsersIds.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace SocialPub.ClientModels.User
|
||||
{
|
||||
public class UsersIds
|
||||
{
|
||||
public IList<string> UserIdList { get; set; } = Array.Empty<string>();
|
||||
}
|
||||
}
|
25
SocialPub.ClientModels/User/ViewUserSettings.cs
Normal file
25
SocialPub.ClientModels/User/ViewUserSettings.cs
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user