55 lines
1.6 KiB
C#
55 lines
1.6 KiB
C#
using MongoDB.Bson;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace BCards.Web.Models;
|
|
|
|
public class OpenGraphCache
|
|
{
|
|
[BsonId]
|
|
[BsonRepresentation(BsonType.ObjectId)]
|
|
public string Id { get; set; } = string.Empty;
|
|
|
|
[BsonElement("url")]
|
|
public string Url { get; set; } = string.Empty;
|
|
|
|
[BsonElement("urlHash")]
|
|
public string UrlHash { get; set; } = string.Empty;
|
|
|
|
[BsonElement("title")]
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
[BsonElement("description")]
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
[BsonElement("image")]
|
|
public string Image { get; set; } = string.Empty;
|
|
|
|
[BsonElement("price")]
|
|
public string Price { get; set; } = string.Empty;
|
|
|
|
[BsonElement("currency")]
|
|
public string Currency { get; set; } = "BRL";
|
|
|
|
[BsonElement("isValid")]
|
|
public bool IsValid { get; set; }
|
|
|
|
[BsonElement("errorMessage")]
|
|
public string ErrorMessage { get; set; } = string.Empty;
|
|
|
|
[BsonElement("cachedAt")]
|
|
public DateTime CachedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
[BsonElement("expiresAt")]
|
|
public DateTime ExpiresAt { get; set; } = DateTime.UtcNow.AddHours(24);
|
|
}
|
|
|
|
public class OpenGraphData
|
|
{
|
|
public string Title { get; set; } = string.Empty;
|
|
public string Description { get; set; } = string.Empty;
|
|
public string Image { get; set; } = string.Empty;
|
|
public string Price { get; set; } = string.Empty;
|
|
public string Currency { get; set; } = "BRL";
|
|
public bool IsValid { get; set; }
|
|
public string ErrorMessage { get; set; } = string.Empty;
|
|
} |