2023-07-21 18:17:58 +08:00
|
|
|
|
namespace ZR.Model.System
|
2021-08-23 16:57:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章表
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarTable("article", "文章管理")]
|
2021-11-27 09:43:04 +08:00
|
|
|
|
[Tenant("0")]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public class Article
|
|
|
|
|
|
{
|
2023-05-04 18:20:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章id
|
|
|
|
|
|
/// </summary>
|
2022-04-23 21:59:34 +08:00
|
|
|
|
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public int Cid { get; set; }
|
2023-05-04 18:20:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章标题
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "文章标题", Length = 254, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public string Title { get; set; }
|
2023-05-04 18:20:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发布时间
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "发布时间")]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public DateTime? CreateTime { get; set; }
|
2023-05-04 18:20:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新时间
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(IsOnlyIgnoreInsert = true, ColumnDescription = "更新时间")]
|
2023-03-14 12:21:43 +08:00
|
|
|
|
public DateTime? UpdateTime { get; set; }
|
2021-08-23 16:57:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章内容
|
|
|
|
|
|
/// </summary>
|
2023-06-10 18:26:18 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "文章内容", ColumnDataType = StaticConfig.CodeFirst_BigString)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public string Content { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 作者名
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "作者名", Length = 20, ExtendedAttribute = ProteryConstant.NOTNULL)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public string AuthorName { get; set; }
|
2023-05-04 18:20:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 发布者用户id
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "发布者用户id", ExtendedAttribute = ProteryConstant.NOTNULL)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public long UserId { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章状态 1、发布 2、草稿
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "文章状态 1、发布 2、草稿", Length = 20)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public string Status { get; set; }
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 编辑器类型 markdown,html
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "编辑器类型markdown,html", ColumnName = "fmt_type", Length = 20, IsNullable = true)]
|
2023-03-14 12:21:43 +08:00
|
|
|
|
public string FmtType { get; set; }
|
2021-08-23 16:57:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 文章标签eg:Net5,java
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "文章标签", Length = 20)]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public string Tags { get; set; }
|
2023-05-28 14:35:22 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 点击量
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "点击量", DefaultValue = "0")]
|
2021-08-23 16:57:25 +08:00
|
|
|
|
public int Hits { get; set; }
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "目录id", ColumnName = "category_Id")]
|
2023-03-14 12:21:43 +08:00
|
|
|
|
public int CategoryId { get; set; }
|
2022-05-16 18:09:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 封面地址
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "封面地址", Length = 255)]
|
2022-05-16 18:09:06 +08:00
|
|
|
|
public string CoverUrl { get; set; }
|
2023-05-28 14:35:22 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否公开 1、公开 0、不公开
|
|
|
|
|
|
/// </summary>
|
2023-06-07 22:28:06 +08:00
|
|
|
|
[SugarColumn(ColumnDescription = "是否公开 1、公开 0、不公开", DefaultValue = "0")]
|
2023-05-28 14:35:22 +08:00
|
|
|
|
public int IsPublic { get; set; }
|
2023-03-14 12:21:43 +08:00
|
|
|
|
|
|
|
|
|
|
[Navigate(NavigateType.OneToOne, nameof(CategoryId), nameof(ArticleCategory.CategoryId))] //自定义关系映射
|
|
|
|
|
|
public ArticleCategory ArticleCategoryNav { get; set; }
|
2021-08-23 16:57:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|