From c6d59c7390d9b7683124bd5bc7447ea5c3bc4e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Sat, 23 Apr 2022 21:59:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E7=AB=A0=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/ArticleController.cs | 4 ++-- ZR.Model/System/Article.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/ArticleController.cs b/ZR.Admin.WebApi/Controllers/System/ArticleController.cs index 9274ccf..3b1e340 100644 --- a/ZR.Admin.WebApi/Controllers/System/ArticleController.cs +++ b/ZR.Admin.WebApi/Controllers/System/ArticleController.cs @@ -141,7 +141,7 @@ namespace ZR.Admin.WebApi.Controllers { //从 Dto 映射到 实体 var addModel = parm.Adapt
().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(); diff --git a/ZR.Model/System/Article.cs b/ZR.Model/System/Article.cs index f82f626..2216f53 100644 --- a/ZR.Model/System/Article.cs +++ b/ZR.Model/System/Article.cs @@ -8,15 +8,15 @@ namespace ZR.Model.System /// /// 文章表 /// - [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; } /// /// 文章内容 @@ -44,6 +44,6 @@ namespace ZR.Model.System /// public string Tags { get; set; } public int Hits { get; set; } - public int Category_id { get; set; } + public int Category_Id { get; set; } } }