From 64f90ce10935e71ab12f5f98892fa78b771eb3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Wed, 21 Mar 2012 00:44:41 +0100 Subject: [PATCH] rooms controller --- .../java/de/ctdo/bunti/control/BuntiController.java | 4 ++++ .../de/ctdo/bunti/control/BuntiControllerImpl.java | 10 ++++++++++ src/main/java/de/ctdo/bunti/web/RestController.java | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ctdo/bunti/control/BuntiController.java b/src/main/java/de/ctdo/bunti/control/BuntiController.java index ae9f0f1..0374d7c 100644 --- a/src/main/java/de/ctdo/bunti/control/BuntiController.java +++ b/src/main/java/de/ctdo/bunti/control/BuntiController.java @@ -1,6 +1,7 @@ package de.ctdo.bunti.control; import de.ctdo.bunti.model.BuntiDevice; +import de.ctdo.bunti.model.Room; import java.util.Collection; import java.util.Map; @@ -12,4 +13,7 @@ public interface BuntiController { boolean updateDeviceData(int deviceId, Map options); + Collection getAllRooms(); + Room getRoomById(int roomId); + } diff --git a/src/main/java/de/ctdo/bunti/control/BuntiControllerImpl.java b/src/main/java/de/ctdo/bunti/control/BuntiControllerImpl.java index bca6fbb..9f99185 100644 --- a/src/main/java/de/ctdo/bunti/control/BuntiControllerImpl.java +++ b/src/main/java/de/ctdo/bunti/control/BuntiControllerImpl.java @@ -54,6 +54,16 @@ public class BuntiControllerImpl implements BuntiController, ApplicationEventPub return false; } + @Override + public Collection getAllRooms() { + return roomsDAO.getRooms(); + } + + @Override + public Room getRoomById(int roomId) { + return roomsDAO.getRoom(roomId); + } + @Override public Collection getAllDevices() { return devicesDAO.getAllDevices(); diff --git a/src/main/java/de/ctdo/bunti/web/RestController.java b/src/main/java/de/ctdo/bunti/web/RestController.java index a6ebce6..5e846a3 100644 --- a/src/main/java/de/ctdo/bunti/web/RestController.java +++ b/src/main/java/de/ctdo/bunti/web/RestController.java @@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; -import javax.validation.Validator; import java.util.*; @Controller