提交 | 用户 | 时间
|
9100b0
|
1 |
package com.iailab.module.data.api.controller; |
潘 |
2 |
|
|
3 |
import com.iailab.framework.common.pojo.CommonResult; |
|
4 |
import com.iailab.framework.common.util.object.ConvertUtils; |
|
5 |
import com.iailab.module.data.api.ind.dto.ApiIndItemQueryDTO; |
|
6 |
import com.iailab.module.data.api.ind.dto.ApiIndItemValueDTO; |
|
7 |
import com.iailab.module.data.ind.collection.IndItemCollector; |
|
8 |
import com.iailab.module.data.ind.item.vo.IndItemValueVO; |
|
9 |
import io.swagger.v3.oas.annotations.Operation; |
|
10 |
import io.swagger.v3.oas.annotations.tags.Tag; |
|
11 |
import lombok.extern.slf4j.Slf4j; |
|
12 |
import org.springframework.beans.factory.annotation.Autowired; |
|
13 |
import org.springframework.web.bind.annotation.GetMapping; |
|
14 |
import org.springframework.web.bind.annotation.RequestMapping; |
|
15 |
import org.springframework.web.bind.annotation.RequestParam; |
|
16 |
import org.springframework.web.bind.annotation.RestController; |
|
17 |
|
|
18 |
import javax.annotation.security.PermitAll; |
|
19 |
import java.util.List; |
|
20 |
|
|
21 |
import static com.iailab.framework.common.pojo.CommonResult.success; |
|
22 |
|
|
23 |
/** |
|
24 |
* @author PanZhibao |
|
25 |
* @Description |
|
26 |
* @createTime 2024年10月10日 |
|
27 |
*/ |
|
28 |
@Slf4j |
|
29 |
@RestController |
|
30 |
@RequestMapping("/api/data/ind-item") |
|
31 |
@Tag(name = "指标") |
9961c7
|
32 |
public class ApiIndItemController { |
9100b0
|
33 |
|
潘 |
34 |
@Autowired |
|
35 |
private IndItemCollector indItemCollector; |
|
36 |
|
|
37 |
@PermitAll |
|
38 |
@GetMapping("/query-ind/default-value") |
|
39 |
@Operation(summary = "查询指标默认值") |
|
40 |
public CommonResult<List<ApiIndItemValueDTO>> queryIndItemDefaultValue(@RequestParam String itemNo) { |
|
41 |
List<IndItemValueVO> list = indItemCollector.queryValue(itemNo); |
|
42 |
return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class)); |
|
43 |
|
|
44 |
} |
|
45 |
|
|
46 |
@PermitAll |
|
47 |
@GetMapping("/query-ind/history-value") |
|
48 |
@Operation(summary = "查询指标历史值") |
|
49 |
public CommonResult<List<ApiIndItemValueDTO>> queryIndItemHistoryValue(@RequestParam ApiIndItemQueryDTO dto) { |
|
50 |
List<IndItemValueVO> list = indItemCollector.queryValue(dto.getItemNo(), dto.getStart(), dto.getEnd()); |
|
51 |
return success(ConvertUtils.sourceToTarget(list, ApiIndItemValueDTO.class)); |
|
52 |
} |
|
53 |
} |