提交 | 用户 | 时间
|
ead005
|
1 |
package com.iailab.module.model.api.controller.admin; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
|
4 |
import com.iailab.module.model.api.mcs.McsApi; |
a4891a
|
5 |
import com.iailab.module.model.api.mcs.dto.*; |
ead005
|
6 |
import com.iailab.module.model.common.utils.ApiSecurityUtils; |
潘 |
7 |
import io.swagger.v3.oas.annotations.Operation; |
|
8 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
9 |
import lombok.extern.slf4j.Slf4j; |
|
10 |
import org.springframework.beans.factory.annotation.Autowired; |
a4891a
|
11 |
import org.springframework.web.bind.annotation.*; |
ead005
|
12 |
|
潘 |
13 |
import javax.annotation.Resource; |
|
14 |
import javax.annotation.security.PermitAll; |
|
15 |
import javax.servlet.http.HttpServletRequest; |
|
16 |
import javax.servlet.http.HttpServletResponse; |
a4891a
|
17 |
import java.util.List; |
ead005
|
18 |
|
潘 |
19 |
/** |
|
20 |
* @author PanZhibao |
|
21 |
* @Description |
|
22 |
* @createTime 2024年11月14日 |
|
23 |
*/ |
|
24 |
@Slf4j |
|
25 |
@RestController |
|
26 |
@RequestMapping("/model/api/mcs") |
|
27 |
@Tag(name = "数据") |
|
28 |
public class McsApiController { |
|
29 |
|
|
30 |
@Resource |
|
31 |
private ApiSecurityUtils apiSecurityUtils; |
|
32 |
|
|
33 |
@Autowired |
|
34 |
private McsApi mcsApi; |
|
35 |
|
|
36 |
@PermitAll |
a4891a
|
37 |
@GetMapping("/predict-item/tree") |
潘 |
38 |
@Operation(summary = "预测项树") |
|
39 |
public CommonResult<List<PredictItemTreeDTO>> getPredictItemTree(HttpServletResponse response, HttpServletRequest |
|
40 |
request) throws Exception { |
|
41 |
apiSecurityUtils.validate(request); |
|
42 |
List<PredictItemTreeDTO> list = mcsApi.getPredictItemTree(); |
|
43 |
return CommonResult.success(list); |
|
44 |
} |
|
45 |
|
|
46 |
@PermitAll |
ead005
|
47 |
@PostMapping("/predict-data/charts") |
潘 |
48 |
@Operation(summary = "预测数据图表") |
|
49 |
public CommonResult<PreDataBarLineRespVO> getPreDataCharts(HttpServletResponse response, HttpServletRequest |
|
50 |
request, @RequestBody PreDataBarLineReqVO reqVO) throws Exception { |
|
51 |
apiSecurityUtils.validate(request); |
9e844c
|
52 |
PreDataBarLineRespVO respVO = new PreDataBarLineRespVO(); |
潘 |
53 |
try { |
|
54 |
respVO = mcsApi.getPreDataCharts(reqVO); |
|
55 |
} catch (Exception e) { |
|
56 |
e.printStackTrace(); |
|
57 |
} |
ead005
|
58 |
return CommonResult.success(respVO); |
潘 |
59 |
} |
|
60 |
|
|
61 |
@PermitAll |
|
62 |
@PostMapping("/predict-data/item-chart") |
|
63 |
@Operation(summary = "预测数据图表") |
|
64 |
public CommonResult<PreDataItemChartRespVO> getPreDataItemChart(HttpServletResponse response, HttpServletRequest |
|
65 |
request, @RequestBody PreDataItemChartReqVO reqVO) throws Exception { |
|
66 |
apiSecurityUtils.validate(request); |
|
67 |
PreDataItemChartRespVO respVO = mcsApi.getPreDataItemChart(reqVO); |
|
68 |
return CommonResult.success(respVO); |
|
69 |
} |
328ef4
|
70 |
|
潘 |
71 |
@PermitAll |
|
72 |
@GetMapping("/predict-data/single-chart") |
|
73 |
@Operation(summary = "预测数据图表") |
|
74 |
public CommonResult<PreDataItemChartRespVO> getPreDataSingleChart(HttpServletResponse response, HttpServletRequest |
|
75 |
request, @RequestBody PreDataSingleChartReqVO reqVO) throws Exception { |
|
76 |
apiSecurityUtils.validate(request); |
|
77 |
PreDataItemChartRespVO respVO = mcsApi.getPreDataSingleChart(reqVO); |
|
78 |
return CommonResult.success(respVO); |
|
79 |
} |
ead005
|
80 |
} |