fix: 调整 job 接口参数校验规则

This commit is contained in:
shizhendong
2024-10-23 10:21:50 +08:00
parent 1a3cf55ff2
commit b2c5a5aad4
2 changed files with 3 additions and 5 deletions

View File

@@ -31,8 +31,6 @@ public class JobController {
@GetMapping("/{workspaceId}/job")
public R list(@PathVariable("workspaceId") String workspaceId,
@RequestParam Map<String, Object> params) {
T.VerifyUtil.is(params).notNull()
.and(workspaceId).notEmpty(RCode.WORKSPACE_ID_CANNOT_EMPTY);
params.put("workspaceId", workspaceId);
Page page = jobService.queryList(params);
return R.ok(page);
@@ -44,9 +42,9 @@ public class JobController {
T.VerifyUtil.is(entity).notNull()
.and(entity.getEnvironmentId()).notEmpty(RCode.ENVIRONMENT_ID_CANNOT_EMPTY)
.and(entity.getPackageId()).notEmpty(RCode.PACKAGE_ID_CANNOT_EMPTY)
.and(entity.getPlaybookId()).notEmpty(RCode.PLAYBOOK_ID_CANNOT_EMPTY)
.and(entity.getWorkspaceId()).notEmpty(RCode.WORKSPACE_ID_CANNOT_EMPTY);
.and(entity.getPlaybookId()).notEmpty(RCode.PLAYBOOK_ID_CANNOT_EMPTY);
entity.setWorkspaceId(workspaceId);
entity.setEnvId(entity.getEnvironmentId());
JobEntity jobEntity = jobService.saveJob(entity);

View File

@@ -47,7 +47,7 @@ public class JobServiceImpl extends ServiceImpl<JobDao, JobEntity> implements IJ
* @return
*/
private String getJobResultPath(String jobId) {
return T.FileUtil.file(T.WebPathUtil.getRootPath(), "result", jobId).getPath();
return T.FileUtil.file(T.WebPathUtil.getRootPath(), "job_result", jobId).getPath();
}
@Override