Saving
This commit is contained in:
35
PrivaPub.ClientModels/User/Avatar/InsertAvatarForm.cs
Normal file
35
PrivaPub.ClientModels/User/Avatar/InsertAvatarForm.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using PrivaPub.ClientModels.Resources;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace PrivaPub.ClientModels.User.Avatar
|
||||
{
|
||||
[JsonSerializable(typeof(InsertAvatarForm))]
|
||||
public class InsertAvatarForm
|
||||
{
|
||||
[JsonIgnore]
|
||||
public string RootId { get; set; }
|
||||
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
StringLength(Constants.MaxAvatarNameLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(Name), ResourceType = typeof(FieldsNameResource))]
|
||||
public string Name { get; set; }//name
|
||||
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
StringLength(Constants.MaxAvatarNameLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(UserName), ResourceType = typeof(FieldsNameResource))]
|
||||
public string UserName { get; set; }//preferredUsername
|
||||
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
StringLength(Constants.MaxAvatarBiographyLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(Biography), ResourceType = typeof(FieldsNameResource))]
|
||||
public string Biography { get; set; }//summary
|
||||
|
||||
public ViewAvatarSettings Settings { get; set; } = new();
|
||||
public Dictionary<string, string> Fields { get; set; } = new();
|
||||
public string PersonalNote { get; set; }
|
||||
}
|
||||
}
|
31
PrivaPub.ClientModels/User/Avatar/UpdateAvatarForm.cs
Normal file
31
PrivaPub.ClientModels/User/Avatar/UpdateAvatarForm.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using PrivaPub.ClientModels.Resources;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PrivaPub.ClientModels.User.Avatar
|
||||
{
|
||||
[JsonSerializable(typeof(UpdateAvatarForm))]
|
||||
public class UpdateAvatarForm
|
||||
{
|
||||
[JsonIgnore]
|
||||
public string RootId { get; set; }
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(AvatarId), ResourceType = typeof(FieldsNameResource))]
|
||||
public string AvatarId { get; set; }
|
||||
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
StringLength(Constants.MaxAvatarNameLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(Name), ResourceType = typeof(FieldsNameResource))]
|
||||
public string Name { get; set; }//name
|
||||
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
StringLength(Constants.MaxAvatarBiographyLength, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(Biography), ResourceType = typeof(FieldsNameResource))]
|
||||
public string Biography { get; set; }//summary
|
||||
|
||||
public ViewAvatarSettings Settings { get; set; } = new();
|
||||
public Dictionary<string, string> Fields { get; set; } = new();
|
||||
public string PersonalNote { get; set; }
|
||||
}
|
||||
}
|
26
PrivaPub.ClientModels/User/Avatar/ViewAvatar.cs
Normal file
26
PrivaPub.ClientModels/User/Avatar/ViewAvatar.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PrivaPub.ClientModels.User.Avatar
|
||||
{
|
||||
[JsonSerializable(typeof(ViewAvatar))]
|
||||
public class ViewAvatar
|
||||
{
|
||||
public string Url { get; set; }//url
|
||||
public string Name { get; set; }//name
|
||||
public string UserName { get; set; }//preferredUsername
|
||||
public string Biography { get; set; }//summary
|
||||
public Dictionary<string, string> Fields { get; set; } = new();
|
||||
|
||||
public string PictureURL { get; set; }//icon
|
||||
public string ThumbnailURL { get; set; }//image
|
||||
public Dictionary<string, string> SharedPersonalContacts { get; set; } = new();
|
||||
|
||||
public ViewAvatarState AccountState { get; set; } = ViewAvatarState.Normal;
|
||||
public ViewAvatarServer ServerType { get; set; } = ViewAvatarServer.Unknown;
|
||||
|
||||
public ViewAvatarSettings Settings { get; set; } = new();
|
||||
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
public DateTime CreatedAt { get; set; }
|
||||
}
|
||||
}
|
29
PrivaPub.ClientModels/User/Avatar/ViewAvatarSettings.cs
Normal file
29
PrivaPub.ClientModels/User/Avatar/ViewAvatarSettings.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using PrivaPub.ClientModels.Resources;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace PrivaPub.ClientModels.User.Avatar
|
||||
{
|
||||
[JsonSerializable(typeof(ViewAvatarSettings))]
|
||||
public class ViewAvatarSettings
|
||||
{
|
||||
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
|
||||
Display(Name = nameof(LanguageCode), ResourceType = typeof(FieldsNameResource))]
|
||||
public string LanguageCode { get; set; } = "en-GB";
|
||||
|
||||
public bool IsDefault { get; set; } = true;
|
||||
|
||||
[Range(-2, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
|
||||
public short IconsThemeIndexColour { get; set; } = 25;
|
||||
[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;
|
||||
|
||||
public bool PreferSystemTheming { get; set; } = true;
|
||||
public bool ThemeIsDarkMode { get; set; } = false;
|
||||
public bool ThemeIsLightGray { get; set; } = true;
|
||||
public bool ThemeIsDarkGray { get; set; } = false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user