package net.northking.cctp.executePlan.pub.ats;

import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.constants.BaseDefineDependencyConstants;
import com.hzbank.testteam.autotest.dependencies.baseDefineDependency.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.executePlan.api.service.AtuPlanInfoApiService;
import net.northking.cctp.executePlan.pub.dto.TestPlanScriptExecutionDetailDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "执行计划脚本执行情况（服务间调用）")
@RequestMapping("/pub")
@RestController
public class TestPlanExecutionToAtsReportPub {

    @Autowired
    private AtuPlanInfoApiService apiService;

    @ApiOperation(value = "ATS获取执行计划中脚本执行情况")
    @PostMapping(value = "/scriptExecutionDetail")
    public ResponseVO<List<TestPlanScriptExecutionDetailDTO>> scriptExecutionDetail() {
        ResponseVO<List<TestPlanScriptExecutionDetailDTO>> responseVO = new ResponseVO<>();
        List<TestPlanScriptExecutionDetailDTO> result = apiService.scriptExecutionDetail();
        responseVO.setCode(BaseDefineDependencyConstants.SYSTEM_RESPONSE_CODE_SUCCESS);
        responseVO.setData(result);
        return responseVO;
    }
}
