| | |
| | | import org.dom4j.io.SAXReader;
|
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.data.redis.core.RedisTemplate;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | |
| | | 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.HistoryMinutelyService;
|
| | | import com.moral.service.DeviceService;
|
| | | import com.moral.service.HistoryService;
|
| | | import com.moral.service.MachineActivateService;
|
| | |
| | | * The Class ScreenController.大屏接口
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("screen")
|
| | | @CrossOrigin(origins = "*", maxAge = 3600)
|
| | | @RequestMapping("/screen")
|
| | | //@CrossOrigin(origins = "*", maxAge = 3600)
|
| | | public class ScreenController {
|
| | |
|
| | | /** The screen service. */
|
| | |
| | | private DeviceService deviceService;
|
| | |
|
| | | @Resource
|
| | | private DataService dataService;
|
| | | private HistoryMinutelyService historyMinutelyService;
|
| | |
|
| | | @Resource
|
| | | private MachineActivateService machineActivateService;
|
| | |
| | | * the request
|
| | | * @return the equipment states
|
| | | */
|
| | | @GetMapping("equipment-state")
|
| | | @GetMapping("/equipment-state")
|
| | | @PreAuthorize("hasAnyRole('USER', 'ADMIN')")
|
| | | public Map<String, Object> getDeviceStatesByAccount(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return deviceService.getDeviceStatesByAccount(parameters);
|
| | |
| | | @GetMapping("day-aqi")
|
| | | public Map<String, Object> getDayAQIByDevice(HttpServletRequest request) {
|
| | | Map<String, Object> parameters = getParametersStartingWith(request, null);
|
| | | return dataService.getDayAQIByDevice(parameters);
|
| | | return historyMinutelyService.getDayAQIByDevice(parameters);
|
| | | }
|
| | |
|
| | | /**
|