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.ChartApiService;
import net.northking.cctp.dw.dto.ChartProgressQueryDto;
import net.northking.cctp.dw.dto.MtTestChartDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: puchao.ma
 * @date: 2021/12/15 17:04
 */
@RestController
@RequestMapping("/v1/testChart")
@Api(tags = "进度图表")
public class MtTestChartCtrl {

    @Autowired
    private ChartApiService chartApiService;

    @PostMapping("/chartProgress")
    @ApiOperation("进度图查询")
    public ResultWrapper<List<MtTestChartDto>> chartProgress(@RequestBody ChartProgressQueryDto queryDto) {
        ResultWrapper<List<MtTestChartDto>> wrapper = new ResultWrapper<>();
        List<MtTestChartDto> chartList = chartApiService.queryChartProgress(queryDto);
        return wrapper.success(chartList);
    }
}
