PowerController.java
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.qgutech.controller;
import com.qgutech.common.JsonResult;
import com.qgutech.model.PowerModel;
import com.qgutech.service.PowerService;
import lombok.extern.slf4j.Slf4j;
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 javax.annotation.Resource;
/**
* @author xxx
* @date 2024/12/15 12:08
* @description
*/
/**
* 徽辰智电公司相关接口
*/
@Slf4j
@RestController
@RequestMapping(value = "/hczd")
public class PowerController {
@Resource
private PowerService powerService;
/**
* 设备统计
*/
@PostMapping("/index")
public JsonResult<?> index(@RequestBody PowerModel powerModel) {
JsonResult<Object> result = new JsonResult<>(true, "操作成功");
result.setData(powerService.getIndex(powerModel));
return result;
}
/**
* BMS日期滚动数据
*/
@PostMapping("/getDate")
public JsonResult<?> getDate(@RequestBody PowerModel powerModel) {
JsonResult<Object> result = new JsonResult<>(true, "操作成功");
String type = powerModel.getType();
result.setData(powerService.getDateMap(type));
return result;
}
}