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.MtCaseDesignApiService;
import net.northking.cctp.dw.dto.CaseDesignPieDto;
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 9:34
 */
@RestController
@RequestMapping("/v1/caseDesign")
@Api(tags = "用例设计数据")
public class MtCaseDesignCtrl {

    @Autowired
    private MtCaseDesignApiService caseDesignService;

    @PostMapping("/caseDesignPie/{projectId}")
    @ApiOperation("用例设计饼图")
    public ResultWrapper<CaseDesignPieDto> caseDesignPie(@PathVariable("projectId") String projectId) {
        ResultWrapper<CaseDesignPieDto> wrapper = new ResultWrapper<>();
        CaseDesignPieDto completes = caseDesignService.caseDesignPie(projectId);
        return wrapper.success(completes);
    }
}
