package net.northking.cctp.dw.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.northking.cctp.common.http.ResultWrapper;
import net.northking.cctp.dw.api.service.MtManualExecJobApiService;
import net.northking.cctp.dw.dto.ManualExecJobPieDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: puchao.ma
 * @date: 2021/12/15 10:17
 */
@RestController
@RequestMapping("/v1/execJob")
@Api(tags = "用例执行数据")
public class MtManualExecJobCtrl {

    @Autowired
    private MtManualExecJobApiService mtManualExecJobApiService;

    @PostMapping("/execJobPie/{projectId}")
    @ApiOperation("用例执行饼图")
    public ResultWrapper<ManualExecJobPieDto> execJobPie(@PathVariable("projectId") String projectId) {
        ResultWrapper<ManualExecJobPieDto> wrapper = new ResultWrapper<>();
        ManualExecJobPieDto execJobPie = mtManualExecJobApiService.execJobPie(projectId);
        return wrapper.success(execJobPie);
    }
}
