package com.qianwen.mdc.collect.controller;
|
|
import java.util.List;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import com.qianwen.mdc.collect.dto.StateAggregateTimeDTO;
|
import com.qianwen.mdc.collect.entity.iotdb.DeviceState;
|
import com.qianwen.mdc.collect.mapper.iotdb.DeviceStateMapper;
|
import com.qianwen.mdc.collect.service.DeviceStateAggregateService;
|
|
@RestController
|
public class StateController {
|
|
@Autowired
|
private DeviceStateAggregateService stateAggregateService;
|
@Autowired
|
private DeviceStateMapper stateMapper;
|
|
@GetMapping("/range")
|
public Object range() {
|
long wod = 1656819188967653378L;
|
StateAggregateTimeDTO timeRange = new StateAggregateTimeDTO();
|
timeRange.setEndTime(System.currentTimeMillis());
|
List<DeviceState> slist = stateMapper.statesInTimeRange(wod, timeRange);
|
|
return "2";
|
}
|
|
@GetMapping("/stateagg")
|
public Object stateagg(Long workstationId) {
|
stateAggregateService.stateAggregate(workstationId);
|
|
return "1";
|
}
|
|
@GetMapping("/lttime")
|
public Object lttime(Long workstationId) {
|
DeviceState s = stateMapper.lastNoFeedbackStateLessThanTime(workstationId,System.currentTimeMillis());
|
|
return s;
|
}
|
|
}
|