Skip to content
Permalink
Browse files
Fix job manager update bug (#247)
  • Loading branch information
shzcore committed Oct 30, 2020
1 parent 872887b commit 914e0c91470fa0fe6b5090da3339a2c48b93297f
Showing 1 changed file with 6 additions and 1 deletion.
@@ -145,7 +145,8 @@ public IPage<JobManager> list(@PathVariable("connId") int connId,
}

@PutMapping("{id}")
public JobManager update(@PathVariable("id") int id,
public JobManager update(@PathVariable("connId") int connId,
@PathVariable("id") int id,
@RequestBody JobManager newEntity) {
Ex.check(newEntity.getJobName().length() <= 48,
"job.manager.job-name.reached-limit");
@@ -160,6 +161,10 @@ public JobManager update(@PathVariable("id") int id,
if (entity == null) {
throw new ExternalException("job-manager.not-exist.id", id);
}
if (!newEntity.getJobName().equals(entity.getJobName()) &&
this.service.getTask(newEntity.getJobName(), connId) != null) {
throw new InternalException("job.manager.job-name.repeated");
}
entity.setJobName(newEntity.getJobName());
entity.setJobRemarks(newEntity.getJobRemarks());
this.service.update(entity);

0 comments on commit 914e0c9

Please sign in to comment.