diff --git a/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/gui/JobConfigController.java b/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/gui/JobConfigController.java index bc068f2b6..894a2f3ab 100644 --- a/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/gui/JobConfigController.java +++ b/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/gui/JobConfigController.java @@ -10,6 +10,7 @@ import com.vip.saturn.job.console.vo.UpdateJobConfigVo; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; @@ -40,11 +41,14 @@ public SuccessResponseEntity getJobConfig(final HttpServletRequest request, @ApiResponses(value = {@ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class)}) @Audit @PostMapping - public SuccessResponseEntity updateJobConfig(final HttpServletRequest request, + public ResponseEntity updateJobConfig(final HttpServletRequest request, @AuditParam("namespace") @PathVariable String namespace, @AuditParam("jobName") @PathVariable String jobName, UpdateJobConfigVo updateJobConfigVo) throws SaturnJobConsoleException { assertIsPermitted(PermissionKeys.jobUpdate, namespace); + if(updateJobConfigVo.getGroups().length() >= 255) { + throw new SaturnJobConsoleException("分组总数不能超过15个"); + } jobService.updateJobConfig(namespace, updateJobConfigVo.toJobConfig(), getCurrentLoginUserName()); return new SuccessResponseEntity(); }