From 04f77c6553ed1ec42c2be459a26a6c4be3a00a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Wed, 21 Mar 2012 22:17:40 +0100 Subject: [PATCH] renamed controller and removed duplicate function to update device data. --- ...ontroller.java => DeviceControlController.java} | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) rename src/main/java/de/ctdo/bunti/web/{RestController.java => DeviceControlController.java} (78%) diff --git a/src/main/java/de/ctdo/bunti/web/RestController.java b/src/main/java/de/ctdo/bunti/web/DeviceControlController.java similarity index 78% rename from src/main/java/de/ctdo/bunti/web/RestController.java rename to src/main/java/de/ctdo/bunti/web/DeviceControlController.java index 5e846a3..9df036d 100644 --- a/src/main/java/de/ctdo/bunti/web/RestController.java +++ b/src/main/java/de/ctdo/bunti/web/DeviceControlController.java @@ -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() );