From a13552d802d8cd5f95866ba7f510de463378086a Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 17 Jul 2024 09:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Api/Controllers/Base/BaseController.cs | 5 ++--- .../Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs | 2 +- Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs | 2 +- Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs | 7 +++++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Base/BaseController.cs b/Tiobon.Core.Api/Controllers/Base/BaseController.cs index d881be0d..d5a6fb67 100644 --- a/Tiobon.Core.Api/Controllers/Base/BaseController.cs +++ b/Tiobon.Core.Api/Controllers/Base/BaseController.cs @@ -76,12 +76,11 @@ public class BaseController> QueryById(long Id) { - var entity1 = await InvokeServiceAsync("QueryById", [Id]); - var entity = ConvertTo(entity1); + var entity = await InvokeServiceAsync("QueryById", [Id]); if (entity is null) return Failed("获取失败"); else - return Success(entity, "获取成功"); + return Success(ConvertTo(entity), "获取成功"); } /// /// 查询菜单表单信息 diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs index 5df7acdf..9ac55c02 100644 --- a/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghre/Ghre_ExamPaperConfig.Dto.Base.cs @@ -87,7 +87,7 @@ namespace Tiobon.Core.Model.Models /// /// 预留字段1 /// - [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + [Display(Name = "Reverse1"), Description("预留字段1")] public string Reverse1 { get; set; } /// diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs index b327dfdf..90bdfc43 100644 --- a/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs +++ b/Tiobon.Core.Model/Models/Ghre/Ghre_ExamPaperConfig.cs @@ -86,7 +86,7 @@ namespace Tiobon.Core.Model.Models /// /// 预留字段1 /// - [Display(Name = "Reverse1"), Description("预留字段1"), MaxLength(1000, ErrorMessage = "预留字段1 不能超过 1000 个字符")] + [Display(Name = "Reverse1"), Description("预留字段1")] public string Reverse1 { get; set; } /// diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index 93d48f05..150be514 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -64,8 +64,11 @@ public class Ghre_ExamPaperServices : BaseServices QueryById(object objId) { var entity = await base.QueryById(objId); - entity.SetMethodLabel = await GetParaLabel("SetMethod", entity.SetMethod); - entity.ScoreMethodLabel = await GetParaLabel("ScoreMethod", entity.ScoreMethod); + if (entity != null) + { + entity.SetMethodLabel = await GetParaLabel("SetMethod", entity.SetMethod); + entity.ScoreMethodLabel = await GetParaLabel("ScoreMethod", entity.ScoreMethod); + } return entity; }