using SqlSugar;
namespace MyHomePage.Api.Models.Entities;
/// 搜索引擎
[SugarTable("search_engines")]
public class SearchEngine : BaseEntity
{
/// 展示名
[SugarColumn(Length = 64, IsNullable = false)]
public string Name { get; set; } = string.Empty;
/// URL 模板,必须包含 {q} 占位符
[SugarColumn(Length = 512, IsNullable = false)]
public string UrlTemplate { get; set; } = string.Empty;
/// 图标类型:lucide / image / emoji(与 Bookmark.IconType 对齐)
[SugarColumn(Length = 16, IsNullable = false, DefaultValue = "lucide")]
public string IconType { get; set; } = "lucide";
/// 图标内容:lucide 名 / emoji 字符(IconType=lucide/emoji 时使用)
[SugarColumn(Length = 64, IsNullable = true)]
public string? Icon { get; set; }
/// 图标图片 URL(IconType=image 时使用)
[SugarColumn(Length = 512, IsNullable = true)]
public string? IconUrl { get; set; }
/// logo 背景色(#hex / rgb / hsl);null = 自适应(与 Bookmark.ColorBg 对齐)
[SugarColumn(Length = 32, IsNullable = true)]
public string? ColorBg { get; set; }
/// 排序值
[SugarColumn(DefaultValue = "0")]
public int Sort { get; set; }
/// 是否默认引擎(应用层保证唯一)
[SugarColumn(DefaultValue = "0")]
public bool IsDefault { get; set; }
}