PictureEditorComponent created
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace WatchIt.Common.Model.Persons;
|
||||
|
||||
public class PersonPhoto : Picture
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Persons;
|
||||
|
||||
public class PersonPhotoRequest : PersonPhoto
|
||||
{
|
||||
#region CONSTRUCTORS
|
||||
|
||||
[JsonConstructor]
|
||||
public PersonPhotoRequest() {}
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public PersonPhotoRequest(Picture image)
|
||||
{
|
||||
Image = image.Image;
|
||||
MimeType = image.MimeType;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region PUBLIC METHODS
|
||||
|
||||
public PersonPhotoImage CreatePersonPhotoImage() => new PersonPhotoImage
|
||||
{
|
||||
Image = Image,
|
||||
MimeType = MimeType,
|
||||
};
|
||||
|
||||
public void UpdatePersonPhotoImage(PersonPhotoImage item)
|
||||
{
|
||||
item.Image = Image;
|
||||
item.MimeType = MimeType;
|
||||
item.UploadDate = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using WatchIt.Database.Model.Person;
|
||||
|
||||
namespace WatchIt.Common.Model.Persons;
|
||||
|
||||
public class PersonPhotoResponse : PersonPhoto
|
||||
{
|
||||
#region PROPERTIES
|
||||
|
||||
[JsonPropertyName("id")]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
[JsonPropertyName("upload_date")]
|
||||
public DateTime UploadDate { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CONSTRUCTORS
|
||||
|
||||
[JsonConstructor]
|
||||
public PersonPhotoResponse() {}
|
||||
|
||||
[SetsRequiredMembers]
|
||||
public PersonPhotoResponse(PersonPhotoImage personPhotoImage)
|
||||
{
|
||||
Id = personPhotoImage.Id;
|
||||
Image = personPhotoImage.Image;
|
||||
MimeType = personPhotoImage.MimeType;
|
||||
UploadDate = personPhotoImage.UploadDate;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user