优化文章管理

This commit is contained in:
不做码农 2022-04-23 21:59:34 +08:00
parent 6d6dd72116
commit c6d59c7390
2 changed files with 6 additions and 6 deletions

View File

@ -141,7 +141,7 @@ namespace ZR.Admin.WebApi.Controllers
{
//从 Dto 映射到 实体
var addModel = parm.Adapt<Article>().ToCreate(context: HttpContext);
addModel.AuthorName = User.Identity.Name;
addModel.AuthorName = HttpContext.GetName();
var response = _ArticleService.Update(it => it.Cid == addModel.Cid,
f => new Article
@ -149,7 +149,7 @@ namespace ZR.Admin.WebApi.Controllers
Title = addModel.Title,
Content = addModel.Content,
Tags = addModel.Tags,
Category_id = addModel.Category_id,
Category_Id = addModel.Category_Id,
UpdateTime = addModel.UpdateTime,
Status = addModel.Status
}).ToCreate();

View File

@ -8,15 +8,15 @@ namespace ZR.Model.System
/// <summary>
/// 文章表
/// </summary>
[SqlSugar.SugarTable("article")]
[SugarTable("article")]
[Tenant("0")]
public class Article
{
[SqlSugar.SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
[SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
public int Cid { get; set; }
public string Title { get; set; }
public DateTime? CreateTime { get; set; }
[SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true)]
[SugarColumn(IsOnlyIgnoreInsert = true)]
public DateTime UpdateTime { get; set; }
/// <summary>
/// 文章内容
@ -44,6 +44,6 @@ namespace ZR.Model.System
/// </summary>
public string Tags { get; set; }
public int Hits { get; set; }
public int Category_id { get; set; }
public int Category_Id { get; set; }
}
}