From 5dfbb9a7c9edff981d9a20a06b0ef0f0638c3f70 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Mon, 23 Mar 2020 19:14:46 +0100 Subject: [PATCH] add media entities --- .gitignore | 2 +- unjo.Core/Entities/Media/Media.cs | 40 +++++++++++++++++++++ unjo.Core/Entities/Media/MediaFocalPoint.cs | 12 +++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 unjo.Core/Entities/Media/Media.cs create mode 100644 unjo.Core/Entities/Media/MediaFocalPoint.cs diff --git a/.gitignore b/.gitignore index 7d02347b..5f5e1a66 100644 --- a/.gitignore +++ b/.gitignore @@ -263,7 +263,7 @@ __pycache__/ # Media folder + app_data App_Data/ -**/Media/ +wwwroot/Media/ Temp/ **/Assets/app.* deps/*.dll \ No newline at end of file diff --git a/unjo.Core/Entities/Media/Media.cs b/unjo.Core/Entities/Media/Media.cs new file mode 100644 index 00000000..a74b29f1 --- /dev/null +++ b/unjo.Core/Entities/Media/Media.cs @@ -0,0 +1,40 @@ +using System; + +namespace unjo.Core.Entities +{ + /// + /// A media file (can contain an image or other media like videos and documents) + /// + public class Media : DatabaseEntity + { + /// + /// Alternative text which is used when the image can't be loaded + /// + public string AlternativeText { get; set; } + + /// + /// Additional caption text + /// + public string Caption { get; set; } + + /// + /// Path of the media item + /// + public string Source { get; set; } + + /// + /// Filesize in bytes + /// + public int Size { get; set; } + + /// + /// Time the file has last changed + /// + public DateTimeOffset LastModifiedDate { get; set; } + + /// + /// Optional focal point for an image + /// + public MediaFocalPoint FocalPoint { get; set; } + } +} diff --git a/unjo.Core/Entities/Media/MediaFocalPoint.cs b/unjo.Core/Entities/Media/MediaFocalPoint.cs new file mode 100644 index 00000000..cb4ca469 --- /dev/null +++ b/unjo.Core/Entities/Media/MediaFocalPoint.cs @@ -0,0 +1,12 @@ +namespace unjo.Core.Entities +{ + /// + /// The focal point sets the point of interest in an image with x/y coordinates from 0-1 + /// + public class MediaFocalPoint + { + public decimal Left { get; set; } + + public decimal Top { get; set; } + } +}