From d7ee352f3aa7ef66f29c0f338c425dde1e6a84ea 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: Tue, 10 May 2022 08:17:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/TasksController.cs | 4 ++++ ZR.Model/System/Dto/TasksDto.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/TasksController.cs b/ZR.Admin.WebApi/Controllers/System/TasksController.cs index 754eef6..933dd7c 100644 --- a/ZR.Admin.WebApi/Controllers/System/TasksController.cs +++ b/ZR.Admin.WebApi/Controllers/System/TasksController.cs @@ -95,6 +95,10 @@ namespace ZR.Admin.WebApi.Controllers { throw new CustomException($"地址不能为空"); } + if (parm.TaskType == 1 && (parm.AssemblyName.IsEmpty() || parm.ClassName.IsEmpty())) + { + throw new CustomException($"程序集或者类名不能为空"); + } //从 Dto 映射到 实体 var tasksQz = parm.Adapt().ToCreate(); var worker = new IdWorker(1, 1); diff --git a/ZR.Model/System/Dto/TasksDto.cs b/ZR.Model/System/Dto/TasksDto.cs index 9b0d9a9..198f439 100644 --- a/ZR.Model/System/Dto/TasksDto.cs +++ b/ZR.Model/System/Dto/TasksDto.cs @@ -53,7 +53,7 @@ namespace ZR.Model.System.Dto /// 默认 : /// [Display(Name = "程序集名称")] - [Required(ErrorMessage = "程序集名称不能为空")] + //[Required(ErrorMessage = "程序集名称不能为空")] public string AssemblyName { get; set; } /// @@ -62,7 +62,7 @@ namespace ZR.Model.System.Dto /// 默认 : /// [Display(Name = "任务所在类")] - [Required(ErrorMessage = "任务所在类不能为空")] + //[Required(ErrorMessage = "任务所在类不能为空")] public string ClassName { get; set; } ///