55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace BCards.Web.Models;
|
|
|
|
public enum LinkType
|
|
{
|
|
Normal = 0, // Link comum
|
|
Product = 1 // Link de produto com preview
|
|
}
|
|
|
|
public class LinkItem
|
|
{
|
|
[BsonElement("title")]
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
[BsonElement("url")]
|
|
public string Url { get; set; } = string.Empty;
|
|
|
|
[BsonElement("description")]
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
[BsonElement("icon")]
|
|
public string Icon { get; set; } = string.Empty;
|
|
|
|
[BsonElement("isActive")]
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
[BsonElement("order")]
|
|
public int Order { get; set; }
|
|
|
|
[BsonElement("clicks")]
|
|
public int Clicks { get; set; } = 0;
|
|
|
|
[BsonElement("createdAt")]
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
// Campos para Link de Produto
|
|
[BsonElement("type")]
|
|
public LinkType Type { get; set; } = LinkType.Normal;
|
|
|
|
[BsonElement("productTitle")]
|
|
public string ProductTitle { get; set; } = string.Empty;
|
|
|
|
[BsonElement("productImage")]
|
|
public string ProductImage { get; set; } = string.Empty;
|
|
|
|
[BsonElement("productPrice")]
|
|
public string ProductPrice { get; set; } = string.Empty;
|
|
|
|
[BsonElement("productDescription")]
|
|
public string ProductDescription { get; set; } = string.Empty;
|
|
|
|
[BsonElement("productDataCachedAt")]
|
|
public DateTime? ProductDataCachedAt { get; set; }
|
|
} |