|
|
@ -7,82 +7,97 @@ |
|
|
|
|
|
|
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using MongoDB.Bson; |
|
|
using MongoDB.Bson.Serialization.Attributes; |
|
|
using MongoDB.Bson.Serialization.Attributes; |
|
|
|
|
|
using NodaTime; |
|
|
using Squidex.Domain.Apps.Core.ValidateContent; |
|
|
using Squidex.Domain.Apps.Core.ValidateContent; |
|
|
using Squidex.Domain.Apps.Entities.Assets; |
|
|
using Squidex.Domain.Apps.Entities.Assets; |
|
|
using Squidex.Infrastructure; |
|
|
using Squidex.Infrastructure; |
|
|
using Squidex.Infrastructure.MongoDb; |
|
|
|
|
|
|
|
|
|
|
|
namespace Squidex.Domain.Apps.Entities.MongoDb.Assets |
|
|
namespace Squidex.Domain.Apps.Entities.MongoDb.Assets |
|
|
{ |
|
|
{ |
|
|
public sealed class MongoAssetEntity : |
|
|
public sealed class MongoAssetEntity : |
|
|
MongoEntity, |
|
|
|
|
|
IAssetEntity, |
|
|
IAssetEntity, |
|
|
IUpdateableEntityWithVersion, |
|
|
IUpdateableEntityWithVersion, |
|
|
IUpdateableEntityWithCreatedBy, |
|
|
IUpdateableEntityWithCreatedBy, |
|
|
IUpdateableEntityWithLastModifiedBy |
|
|
IUpdateableEntityWithLastModifiedBy |
|
|
{ |
|
|
{ |
|
|
|
|
|
[BsonId] |
|
|
|
|
|
[BsonElement("_id")] |
|
|
|
|
|
[BsonRepresentation(BsonType.String)] |
|
|
|
|
|
public Guid Id { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement("AppIdId")] |
|
|
[BsonElement("_ai")] |
|
|
|
|
|
[BsonRepresentation(BsonType.String)] |
|
|
public Guid IndexedAppId { get; set; } |
|
|
public Guid IndexedAppId { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("ct")] |
|
|
|
|
|
public Instant Created { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
|
|
|
[BsonElement("mt")] |
|
|
|
|
|
public Instant LastModified { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
|
|
|
[BsonElement("ai")] |
|
|
public NamedId<Guid> AppId { get; set; } |
|
|
public NamedId<Guid> AppId { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("mm")] |
|
|
public string MimeType { get; set; } |
|
|
public string MimeType { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("fn")] |
|
|
public string FileName { get; set; } |
|
|
public string FileName { get; set; } |
|
|
|
|
|
|
|
|
[BsonIgnoreIfDefault] |
|
|
[BsonIgnoreIfDefault] |
|
|
[BsonElement] |
|
|
[BsonElement("fh")] |
|
|
public string FileHash { get; set; } |
|
|
public string FileHash { get; set; } |
|
|
|
|
|
|
|
|
[BsonIgnoreIfDefault] |
|
|
[BsonIgnoreIfDefault] |
|
|
[BsonElement] |
|
|
[BsonElement("sl")] |
|
|
public string Slug { get; set; } |
|
|
public string Slug { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("fs")] |
|
|
public long FileSize { get; set; } |
|
|
public long FileSize { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("fv")] |
|
|
public long FileVersion { get; set; } |
|
|
public long FileVersion { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("im")] |
|
|
public bool IsImage { get; set; } |
|
|
public bool IsImage { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("vs")] |
|
|
public long Version { get; set; } |
|
|
public long Version { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("pw")] |
|
|
public int? PixelWidth { get; set; } |
|
|
public int? PixelWidth { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("ph")] |
|
|
public int? PixelHeight { get; set; } |
|
|
public int? PixelHeight { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("cb")] |
|
|
public RefToken CreatedBy { get; set; } |
|
|
public RefToken CreatedBy { get; set; } |
|
|
|
|
|
|
|
|
[BsonRequired] |
|
|
[BsonRequired] |
|
|
[BsonElement] |
|
|
[BsonElement("mb")] |
|
|
public RefToken LastModifiedBy { get; set; } |
|
|
public RefToken LastModifiedBy { get; set; } |
|
|
|
|
|
|
|
|
[BsonIgnoreIfNull] |
|
|
[BsonIgnoreIfNull] |
|
|
[BsonElement] |
|
|
[BsonElement("td")] |
|
|
public HashSet<string> Tags { get; set; } |
|
|
public HashSet<string> Tags { get; set; } |
|
|
|
|
|
|
|
|
[BsonElement] |
|
|
[BsonRequired] |
|
|
|
|
|
[BsonElement("dl")] |
|
|
public bool IsDeleted { get; set; } |
|
|
public bool IsDeleted { get; set; } |
|
|
|
|
|
|
|
|
Guid IAssetInfo.AssetId |
|
|
Guid IAssetInfo.AssetId |
|
|
|