renamed controller and removed duplicate function to update device data.

This commit is contained in:
Lucas Pleß 2012-03-21 22:17:40 +01:00
parent c09e08200f
commit 04f77c6553
1 changed files with 2 additions and 12 deletions

View File

@ -14,11 +14,10 @@ import java.util.*;
@Controller
@RequestMapping(value = "/control")
public class RestController {
private static final Logger LOGGER = LoggerFactory.getLogger(RestController.class);
public class DeviceControlController {
private static final Logger LOGGER = LoggerFactory.getLogger(DeviceControlController.class);
private BuntiController controller;
@Autowired
public final void setController(BuntiController controller) {
this.controller = controller;
@ -36,15 +35,6 @@ public class RestController {
return controller.getDeviceById(id);
}
@RequestMapping(value = "/devices/{id}", method = RequestMethod.POST)
public @ResponseBody BuntiDevice setDeviceById(@PathVariable("id") int id, @RequestBody DeviceUpdate update) {
LOGGER.info("handle PUT /devices/" + id + " request update=" + update.toString() );
controller.updateDeviceData(id, update.getOptions());
return controller.getDeviceById(id);
}
@RequestMapping(value = "/devices", method = RequestMethod.POST)
public String setDevices(@RequestBody DeviceUpdates updates) {
LOGGER.info("handle PUT /devices" + " request update=" + updates.toString() );