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; } ///