| | |
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alibaba.fastjson.JSONReader;
|
| | | import com.alibaba.fastjson.TypeReference;
|
| | | import com.moral.common.bean.ResultBean;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.service.AccountService;
|
| | | import com.moral.service.DataService;
|
| | | import com.moral.service.DeviceService;
|
| | | import com.moral.service.HistoryService;
|
| | | import com.moral.service.MachineActivateService;
|
| | |
| | | /** The device service. */
|
| | | @Resource
|
| | | private DeviceService deviceService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private DataService dataService;
|
| | |
|
| | | @Resource
|
| | | private MachineActivateService machineActivateService;
|
| | |
|
| | |
| | | @GetMapping("day-aqi")
|
| | | public Map<String, Object> getDayAQIByDevice(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return historyService.getDayAQIByDevice(parameters);
|
| | | return dataService.getDayAQIByDevice(parameters);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | @GetMapping("check-activate")
|
| | | public Map<String, Object> checkActivate(String macCpuCode) {
|
| | | return machineActivateService.checkActivate(macCpuCode);
|
| | | public ResultBean<Integer> checkActivate(String macCpuCode) {
|
| | | Integer result = machineActivateService.checkActivate(macCpuCode);
|
| | | return new ResultBean<Integer>(result);
|
| | | }
|
| | |
|
| | | @PostMapping("activate-machine")
|
| | | public Map<String, Object> activateMachine(HttpServletRequest request) {
|
| | | public ResultBean<Integer> activateMachine(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return machineActivateService.activateMachine(parameters);
|
| | | Integer result = machineActivateService.activateMachine(parameters);
|
| | | return new ResultBean<Integer>(result);
|
| | | }
|
| | |
|
| | | }
|