新增自定义数据校验

This commit is contained in:
RuoYi
2019-07-19 09:53:45 +08:00
parent 3fc965e0e7
commit bf6c66a77b
24 changed files with 214 additions and 42 deletions

View File

@ -6,6 +6,7 @@ import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
@ -125,7 +126,7 @@ public class SysJobController extends BaseController
@RequiresPermissions("monitor:job:add")
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysJob job) throws SchedulerException, TaskException
public AjaxResult addSave(@Validated SysJob job) throws SchedulerException, TaskException
{
return toAjax(jobService.insertJob(job));
}
@ -147,7 +148,7 @@ public class SysJobController extends BaseController
@RequiresPermissions("monitor:job:edit")
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysJob job) throws SchedulerException, TaskException
public AjaxResult editSave(@Validated SysJob job) throws SchedulerException, TaskException
{
return toAjax(jobService.updateJob(job));
}