Browse Source

improvement

pull/3/MERGE
Zhou Zheng 4 years ago
parent
commit
92e70b94cc
  1. 8
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java
  2. 2
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java

8
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/TaskInstanceController.java

@ -118,16 +118,16 @@ public class TaskInstanceController extends BaseController {
} }
/** /**
* change one single task instance's state from failure to forced success * change one single task instance's state from FAILURE to FORCED_SUCCESS
* *
* @param loginUser login user * @param loginUser login user
* @param projectName project name * @param projectName project name
* @param taskInstanceId task instance id * @param taskInstanceId task instance id
* @return the result code and msg * @return the result code and msg
*/ */
@ApiOperation(value = "force-success", notes = "") @ApiOperation(value = "force-success", notes = "FORCE_SINGLE_TASK_SUCCESS")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "taskInstanceId", value = "TASK_INTSTANCE_ID", required = true, dataType = "Int", example = "2") @ApiImplicitParam(name = "taskInstanceId", value = "TASK_INSTANCE_ID", required = true, dataType = "Int", example = "12")
}) })
@PostMapping(value = "/force-success") @PostMapping(value = "/force-success")
@ResponseStatus(HttpStatus.OK) @ResponseStatus(HttpStatus.OK)
@ -136,7 +136,7 @@ public class TaskInstanceController extends BaseController {
@ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName, @ApiParam(name = "projectName", value = "PROJECT_NAME", required = true) @PathVariable String projectName,
@RequestParam(value = "taskInstanceId") Integer taskInstanceId) { @RequestParam(value = "taskInstanceId") Integer taskInstanceId) {
logger.info("force task success, login user: {}, project:{}, task instance id:{}", logger.info("force task success, login user: {}, project:{}, task instance id:{}",
loginUser.getUserName(), projectName.replaceAll("[\n|\r|\t]", "_"), taskInstanceId); loginUser.getUserName(), projectName, taskInstanceId);
Map<String, Object> result = taskInstanceService.forceSingleTaskSuccess(loginUser, projectName, taskInstanceId); Map<String, Object> result = taskInstanceService.forceSingleTaskSuccess(loginUser, projectName, taskInstanceId);
return returnDataList(result); return returnDataList(result);
} }

2
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/TaskInstanceControllerTest.java

@ -81,7 +81,7 @@ public class TaskInstanceControllerTest extends AbstractControllerTest{
} }
@Test @Test
public void forceSingleTaskSuccess() throws Exception { public void testForceSingleTaskSuccess() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>(); MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("taskInstanceId","104"); paramsMap.add("taskInstanceId","104");

Loading…
Cancel
Save