use of com.flink.platform.web.config.annotation.ApiException in project flink-platform-backend by itinycheng.
the class JobFlowController method create.
@ApiException
@PostMapping(value = "/create")
public ResultInfo<Long> create(@RequestAttribute(value = Constant.SESSION_USER) User loginUser, @RequestBody JobFlowRequest jobFlowRequest) {
String errorMsg = jobFlowRequest.validateOnCreate();
if (StringUtils.isNotBlank(errorMsg)) {
return failure(ERROR_PARAMETER, errorMsg);
}
JobFlow jobFlow = jobFlowRequest.getJobFlow();
jobFlow.setId(null);
jobFlow.setCode(UuidGenerator.generateShortUuid());
jobFlow.setUserId(loginUser.getId());
jobFlow.setStatus(JobFlowStatus.OFFLINE);
jobFlowService.save(jobFlow);
return ResultInfo.success(jobFlowRequest.getId());
}
Aggregations