caishunfeng commented on code in PR #11747: URL: https://github.com/apache/dolphinscheduler/pull/11747#discussion_r965686669
########## dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/taskInstance/TaskInstanceSuccessResponse.java: ########## @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.dolphinscheduler.api.dto.taskInstance; + +import lombok.Data; +import org.apache.dolphinscheduler.api.utils.PageInfo; +import org.apache.dolphinscheduler.api.utils.Result; +import org.apache.dolphinscheduler.dao.entity.Project; + +/** + * task instance success response + */ +@Data +public class TaskInstanceSuccessResponse extends Result { + + private PageInfo<Project> data; Review Comment: ```suggestion private PageInfo<TaskInstance> data; ``` ########## dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/ApiApplicationServer.java: ########## @@ -26,6 +26,8 @@ import org.apache.dolphinscheduler.spi.params.PluginParamsTransfer; import org.apache.dolphinscheduler.spi.params.base.PluginParams; +import springfox.documentation.swagger2.annotations.EnableSwagger2; Review Comment: It seems no use. ########## dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TaskInstanceServiceImpl.java: ########## @@ -182,19 +182,19 @@ public Result queryTaskListPaging(User loginUser, /** * change one task instance's state from failure to forced success * - * @param loginUser login user - * @param projectCode project code + * @param loginUser login user + * @param projectCode project code * @param taskInstanceId task instance id * @return the result code and msg */ @Transactional @Override - public Map<String, Object> forceTaskSuccess(User loginUser, long projectCode, Integer taskInstanceId) { + public Result forceTaskSuccess(User loginUser, long projectCode, Integer taskInstanceId) { + Result result = new Result(); Project project = projectMapper.queryByCode(projectCode); // check user access for project - Map<String, Object> result = - projectService.checkProjectAndAuth(loginUser, project, projectCode, FORCED_SUCCESS); - if (result.get(Constants.STATUS) != Status.SUCCESS) { + projectService.checkProjectAndAuth(result, loginUser, project, projectCode, FORCED_SUCCESS); Review Comment: Please recovery the code here, we should avoid the change the input params in the method. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
