using ZR.Model.System; namespace ZR.ServiceCore.Model { /// /// 文章表 /// [SugarTable("article", "文章管理")] [Tenant("0")] public class Article { /// /// 文章id /// [SugarColumn(IsIdentity = true, IsPrimaryKey = true)] public int Cid { get; set; } /// /// 文章标题 /// [SugarColumn(ColumnDescription = "文章标题", Length = 254, ExtendedAttribute = ProteryConstant.NOTNULL)] public string Title { get; set; } /// /// 发布时间 /// [SugarColumn(ColumnDescription = "发布时间")] public DateTime? CreateTime { get; set; } /// /// 更新时间 /// [SugarColumn(IsOnlyIgnoreInsert = true, ColumnDescription = "更新时间")] public DateTime? UpdateTime { get; set; } /// /// 文章内容 /// [SugarColumn(ColumnDescription = "文章内容", ColumnDataType = StaticConfig.CodeFirst_BigString)] public string Content { get; set; } /// /// 作者名 /// [SugarColumn(ColumnDescription = "作者名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)] public string AuthorName { get; set; } /// /// 发布者用户id /// [SugarColumn(ColumnDescription = "发布者用户id", ExtendedAttribute = ProteryConstant.NOTNULL)] public long UserId { get; set; } /// /// 文章状态 1、发布 2、草稿 /// [SugarColumn(ColumnDescription = "文章状态 1、发布 2、草稿", Length = 20)] public string Status { get; set; } /// /// 编辑器类型 markdown,html /// [SugarColumn(ColumnDescription = "编辑器类型markdown,html", ColumnName = "fmt_type", Length = 20, IsNullable = true)] public string FmtType { get; set; } /// /// 文章标签eg:Net5,java /// [SugarColumn(ColumnDescription = "文章标签", Length = 20)] public string Tags { get; set; } /// /// 点击量 /// [SugarColumn(ColumnDescription = "点击量", DefaultValue = "0")] public int Hits { get; set; } [SugarColumn(ColumnDescription = "目录id", ColumnName = "category_Id")] public int CategoryId { get; set; } /// /// 封面地址 /// [SugarColumn(ColumnDescription = "封面地址", Length = 255)] public string CoverUrl { get; set; } /// /// 是否公开 1、公开 0、不公开 /// [SugarColumn(ColumnDescription = "是否公开 1、公开 0、不公开", DefaultValue = "0")] public int IsPublic { get; set; } [Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射 public ArticleCategory ArticleCategoryNav { get; set; } } }