Merge remote-tracking branch 'origin/v13/dev' into v14/dev
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public class ApiElement : IApiElement
|
||||
@@ -11,6 +13,9 @@ public class ApiElement : IApiElement
|
||||
|
||||
public Guid Id { get; }
|
||||
|
||||
// Ensure the ContentType property is serialized first
|
||||
// This is needed so it can be used as a discriminator field by System.Text.Json
|
||||
[JsonPropertyOrder(-100)]
|
||||
public string ContentType { get; }
|
||||
|
||||
public IDictionary<string, object?> Properties { get; }
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public interface IApiElement
|
||||
{
|
||||
Guid Id { get; }
|
||||
|
||||
// Ensure the ContentType property is serialized first
|
||||
// This is needed so it can be used as a discriminator field by System.Text.Json
|
||||
[JsonPropertyOrder(-100)]
|
||||
string ContentType { get; }
|
||||
|
||||
IDictionary<string, object?> Properties { get; }
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public interface IApiMediaWithCrops : IApiMedia
|
||||
{
|
||||
public ImageFocalPoint? FocalPoint { get; }
|
||||
|
||||
public IEnumerable<ImageCrop>? Crops { get; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public interface IApiMediaWithCropsResponse : IApiMediaWithCrops
|
||||
{
|
||||
public string Path { get; }
|
||||
|
||||
public DateTime CreateDate { get; }
|
||||
|
||||
public DateTime UpdateDate { get; }
|
||||
}
|
||||
20
src/Umbraco.Core/Models/DeliveryApi/ImageCrop.cs
Normal file
20
src/Umbraco.Core/Models/DeliveryApi/ImageCrop.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public class ImageCrop
|
||||
{
|
||||
public ImageCrop(string? alias, int width, int height, ImageCropCoordinates? coordinates)
|
||||
{
|
||||
Alias = alias;
|
||||
Width = width;
|
||||
Height = height;
|
||||
Coordinates = coordinates;
|
||||
}
|
||||
|
||||
public string? Alias { get; }
|
||||
|
||||
public int Width { get; }
|
||||
|
||||
public int Height { get; }
|
||||
|
||||
public ImageCropCoordinates? Coordinates { get; }
|
||||
}
|
||||
20
src/Umbraco.Core/Models/DeliveryApi/ImageCropCoordinates.cs
Normal file
20
src/Umbraco.Core/Models/DeliveryApi/ImageCropCoordinates.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public class ImageCropCoordinates
|
||||
{
|
||||
public ImageCropCoordinates(decimal x1, decimal y1, decimal x2, decimal y2)
|
||||
{
|
||||
X1 = x1;
|
||||
Y1 = y1;
|
||||
X2 = x2;
|
||||
Y2 = y2;
|
||||
}
|
||||
|
||||
public decimal X1 { get; }
|
||||
|
||||
public decimal Y1 { get; }
|
||||
|
||||
public decimal X2 { get; }
|
||||
|
||||
public decimal Y2 { get; }
|
||||
}
|
||||
14
src/Umbraco.Core/Models/DeliveryApi/ImageFocalPoint.cs
Normal file
14
src/Umbraco.Core/Models/DeliveryApi/ImageFocalPoint.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Umbraco.Cms.Core.Models.DeliveryApi;
|
||||
|
||||
public class ImageFocalPoint
|
||||
{
|
||||
public ImageFocalPoint(decimal left, decimal top)
|
||||
{
|
||||
Left = left;
|
||||
Top = top;
|
||||
}
|
||||
|
||||
public decimal Left { get; }
|
||||
|
||||
public decimal Top { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user