using SqlSugar; namespace MyHomePage.Api.Models.Entities; /// 链接收藏 [SugarTable("bookmarks")] public class Bookmark : BaseEntity { /// 所属分类 ID [SugarColumn(IsNullable = false, IndexGroupNameList = new[] { "idx_category" })] public int CategoryId { get; set; } /// 链接标题 [SugarColumn(Length = 128, IsNullable = false)] public string Title { get; set; } = string.Empty; /// 链接 URL [SugarColumn(Length = 512, IsNullable = false)] public string Url { get; set; } = string.Empty; /// 简介 [SugarColumn(Length = 512, IsNullable = true)] public string? Description { get; set; } /// 图标标识:lucide 名 / emoji / 自定义 key [SugarColumn(Length = 64, IsNullable = true)] public string? Icon { get; set; } /// 图标类型:lucide | emoji | image [SugarColumn(Length = 16, IsNullable = true, DefaultValue = "lucide")] public string IconType { get; set; } = "lucide"; /// 图标 URL(IconType = image 时使用) [SugarColumn(Length = 512, IsNullable = true)] public string? IconUrl { get; set; } /// logo 背景色(#hex / rgb / hsl);null = 自适应(由前端从 url / iconUrl 推断) [SugarColumn(Length = 32, IsNullable = true)] public string? ColorBg { get; set; } /// 排序值 [SugarColumn(DefaultValue = "0")] public int Sort { get; set; } /// 软删标记 [SugarColumn(DefaultValue = "0")] public bool IsDeleted { get; set; } }