package com.iailab.module.model.api.controller.admin;
|
|
import com.iailab.framework.common.pojo.CommonResult;
|
import com.iailab.module.model.api.mcs.McsApi;
|
import com.iailab.module.model.api.mcs.dto.*;
|
import com.iailab.module.model.common.utils.ApiSecurityUtils;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
import javax.annotation.security.PermitAll;
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
|
/**
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年11月14日
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/model/api/mcs")
|
@Tag(name = "数据")
|
public class McsApiController {
|
|
@Resource
|
private ApiSecurityUtils apiSecurityUtils;
|
|
@Autowired
|
private McsApi mcsApi;
|
|
@PermitAll
|
@GetMapping("/predict-item/tree")
|
@Operation(summary = "预测项树")
|
public CommonResult<List<PredictItemTreeDTO>> getPredictItemTree(HttpServletResponse response, HttpServletRequest
|
request) throws Exception {
|
apiSecurityUtils.validate(request);
|
List<PredictItemTreeDTO> list = mcsApi.getPredictItemTree();
|
return CommonResult.success(list);
|
}
|
|
@PermitAll
|
@PostMapping("/predict-data/charts")
|
@Operation(summary = "预测数据图表")
|
public CommonResult<PreDataBarLineRespVO> getPreDataCharts(HttpServletResponse response, HttpServletRequest
|
request, @RequestBody PreDataBarLineReqVO reqVO) throws Exception {
|
apiSecurityUtils.validate(request);
|
PreDataBarLineRespVO respVO = mcsApi.getPreDataCharts(reqVO);
|
return CommonResult.success(respVO);
|
}
|
|
@PermitAll
|
@PostMapping("/predict-data/item-chart")
|
@Operation(summary = "预测数据图表")
|
public CommonResult<PreDataItemChartRespVO> getPreDataItemChart(HttpServletResponse response, HttpServletRequest
|
request, @RequestBody PreDataItemChartReqVO reqVO) throws Exception {
|
apiSecurityUtils.validate(request);
|
PreDataItemChartRespVO respVO = mcsApi.getPreDataItemChart(reqVO);
|
return CommonResult.success(respVO);
|
}
|
}
|