Skip to content

Commit

Permalink
#1124 作业支持多分组,更新作业配置时分组长度做校验
Browse files Browse the repository at this point in the history
  • Loading branch information
cmzdandan committed Dec 17, 2019
1 parent dc4aea1 commit 5c0980d
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down

1 comment on commit 5c0980d

@heziai
Copy link
Member

@heziai heziai commented on 5c0980d Dec 26, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.