diff --git a/src/backend/job-analysis/service-job-analysis/src/main/java/com/tencent/bk/job/analysis/service/ai/context/impl/TaskContextServiceImpl.java b/src/backend/job-analysis/service-job-analysis/src/main/java/com/tencent/bk/job/analysis/service/ai/context/impl/TaskContextServiceImpl.java index 05c90495fd..5e13d289d8 100644 --- a/src/backend/job-analysis/service-job-analysis/src/main/java/com/tencent/bk/job/analysis/service/ai/context/impl/TaskContextServiceImpl.java +++ b/src/backend/job-analysis/service-job-analysis/src/main/java/com/tencent/bk/job/analysis/service/ai/context/impl/TaskContextServiceImpl.java @@ -62,6 +62,7 @@ public TaskContext getTaskContext(String username, TaskContextQuery contextQuery InternalResponse resp = serviceStepInstanceResource.getStepInstance( username, contextQuery.getAppId(), + contextQuery.getTaskInstanceId(), contextQuery.getStepInstanceId() ); if (resp.isSuccess()) { diff --git a/src/backend/job-execute/api-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResource.java b/src/backend/job-execute/api-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResource.java index cd75c5aaf2..396edc5efa 100644 --- a/src/backend/job-execute/api-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResource.java +++ b/src/backend/job-execute/api-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResource.java @@ -41,13 +41,16 @@ @SmartFeignClient(value = "job-execute", contextId = "stepInstanceResource") @InternalAPI public interface ServiceStepInstanceResource { - @GetMapping("/service/stepInstance/app/{appId}/stepInstanceId/{stepInstanceId}") + @GetMapping("/service/app/{appId}/taskInstance/{taskInstanceId}/stepInstance/{stepInstanceId}") InternalResponse getStepInstance( @RequestHeader("username") String username, @ApiParam(value = "作业平台业务ID", required = true) @PathVariable(value = "appId") Long appId, + @ApiParam(value = "作业实例ID", name = "taskInstanceId", required = true) + @PathVariable("taskInstanceId") + Long taskInstanceId, @ApiParam(value = "步骤实例ID", name = "stepInstanceId", required = true) @PathVariable("stepInstanceId") Long stepInstanceId); diff --git a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResourceImpl.java b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResourceImpl.java index 1b9fb10d5b..4b0177b1ea 100644 --- a/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResourceImpl.java +++ b/src/backend/job-execute/service-job-execute/src/main/java/com/tencent/bk/job/execute/api/inner/ServiceStepInstanceResourceImpl.java @@ -52,9 +52,13 @@ public ServiceStepInstanceResourceImpl(TaskInstanceAccessProcessor taskInstanceA } @Override - public InternalResponse getStepInstance(String username, Long appId, Long stepInstanceId) { + public InternalResponse getStepInstance(String username, + Long appId, + Long taskInstanceId, + Long stepInstanceId) { try { - StepInstanceDTO stepInstance = stepInstanceService.getStepInstanceDetail(appId, stepInstanceId); + StepInstanceDTO stepInstance = stepInstanceService.getStepInstanceDetail(appId, + taskInstanceId, stepInstanceId); taskInstanceAccessProcessor.processBeforeAccess(username, appId, stepInstance.getTaskInstanceId()); return InternalResponse.buildSuccessResp(stepInstance.toServiceStepInstanceDTO()); } catch (NotFoundException e) {