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.MtTestPointApiService;
import net.northking.cctp.dw.dto.TestPointPieDto;
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/14 15:22
 */
@RestController
@RequestMapping("/v1/testPoint")
@Api(tags = "测试点数据")
public class MtTestPointCtrl {

    @Autowired
    private MtTestPointApiService mtTestPointApiService;

    @PostMapping("/testPointPie/{projectId}")
    @ApiOperation("测试点饼图")
    public ResultWrapper<TestPointPieDto> testPointPie(@PathVariable("projectId") String projectId) {
        ResultWrapper<TestPointPieDto> wrapper = new ResultWrapper<>();
        TestPointPieDto completes = mtTestPointApiService.testPointPie(projectId);
        return wrapper.success(completes);
    }

}
