using ZR.Model.Enum;
namespace ZR.Model.Content
{
///
/// 文章表
///
[SugarTable("article", "内容管理")]
[Tenant("0")]
public class Article
{
///
/// 文章id
///
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public long Cid { get; set; }
///
/// 文章标题
///
[SugarColumn(ColumnDescription = "文章标题", Length = 254)]
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 = "editorType", Length = 20, IsNullable = true)]
public string EditorType { 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 = 5000)]
public string CoverUrl { get; set; }
///
/// 是否公开 1、公开 0、不公开
///
[SugarColumn(ColumnDescription = "是否公开 1、公开 0、不公开", DefaultValue = "0")]
public int IsPublic { get; set; }
///
/// 是否置顶
///
public int IsTop { get; set; }
///
/// 0、文章 1、随笔 2、动态
///
[SugarColumn(ColumnDescription = "内容类型0、文章 1、随笔 2、动态", DefaultValue = "0")]
public ArticleTypeEnum ArticleType { get; set; }
///
/// 摘要
///
public string AbstractText { get; set; }
///
/// 分类
///
[Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射
public ArticleCategory CategoryNav { get; set; }
///
/// 评论数
///
public int CommentNum { get; set; }
///
/// 点赞数
///
public int PraiseNum { get; set; }
///
/// 用户IP
///
public string UserIP { get; set; }
///
/// 地理位置
///
public string Location { get; set; }
///
/// 话题ID
///
public long TopicId { get; set; }
///
/// 评论开关 0、所有人可评论 1、仅粉丝 2、仅自己
///
public CommentSwitchEnum CommentSwitch { get; set; }
///
/// 审核状态 0、待审核 1、通过 2、拒绝
///
public AuditStatusEnum AuditStatus { get; set; }
}
}