修改定时任务添加参数校验
This commit is contained in:
parent
87b0501495
commit
d7ee352f3a
@ -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<SysTasksQz>().ToCreate();
|
||||
var worker = new IdWorker(1, 1);
|
||||
|
||||
@ -53,7 +53,7 @@ namespace ZR.Model.System.Dto
|
||||
/// 默认 :
|
||||
/// </summary>
|
||||
[Display(Name = "程序集名称")]
|
||||
[Required(ErrorMessage = "程序集名称不能为空")]
|
||||
//[Required(ErrorMessage = "程序集名称不能为空")]
|
||||
public string AssemblyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -62,7 +62,7 @@ namespace ZR.Model.System.Dto
|
||||
/// 默认 :
|
||||
/// </summary>
|
||||
[Display(Name = "任务所在类")]
|
||||
[Required(ErrorMessage = "任务所在类不能为空")]
|
||||
//[Required(ErrorMessage = "任务所在类不能为空")]
|
||||
public string ClassName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user