Exemplo n.º 1
0
 @RequestMapping("/programme_devices_status/{id}")
 public @ResponseBody DeviceStatus[] getProgrammeDeviceStatus(@PathVariable("id") long id) {
   ProgrammeDevice[] devices =
       powerControlDeviceService.getProgrammeStatus(id).getProgrammeDevices();
   DeviceStatus[] deviceStatus = new DeviceStatus[devices.length];
   for (int i = 0; i < devices.length; i++) {
     deviceStatus[i] = new DeviceStatus(devices[i].getDevice());
   }
   return deviceStatus;
 }
Exemplo n.º 2
0
 @RequestMapping("/programme_detail/{id}")
 public @ResponseBody ModelAndView getProgrammes(@PathVariable("id") long id) {
   ModelAndView mav = new ModelAndView("programme_detail");
   mav.addObject("programmeStatus", powerControlDeviceService.getProgrammeStatus(id));
   return mav;
 }