This commit is contained in:
Lucas Pleß 2012-03-30 17:00:30 +02:00
parent a5329a0bcc
commit 2c7694036d
3 changed files with 13 additions and 8 deletions

View File

@ -11,7 +11,7 @@ import java.util.Map;
public class EthersexMixerImpl implements EthersexMixer, ApplicationListener<DeviceChangedEvent> {
private static final Logger LOGGER = LoggerFactory.getLogger(EthersexMixerImpl.class);
private boolean hasDataChanged = true;
// private boolean hasDataChanged = true;
@Override
public final boolean updateDevice(BuntiDevice device, Map<String, Object> options) {

View File

@ -19,17 +19,20 @@ public class DevicesController {
}
@RequestMapping(value = "", method = RequestMethod.GET)
public @ResponseBody Collection<BuntiDevice> getAll() {
@ResponseBody
public Collection<BuntiDevice> getAll() {
return devicesDAO.getAllDevices();
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public @ResponseBody BuntiDevice getDeviceById(@PathVariable("id") int id) {
@ResponseBody
public BuntiDevice getDeviceById(@PathVariable("id") int id) {
return devicesDAO.getDeviceById(id);
}
@RequestMapping(value = "", method = RequestMethod.POST)
public @ResponseBody BuntiDevice setDevices(@RequestBody BuntiDevice device) {
@ResponseBody
public BuntiDevice setDevices(@RequestBody BuntiDevice device) {
devicesDAO.addDevice(device);
return device;
}

View File

@ -21,18 +21,20 @@ public class RoomsController {
}
@RequestMapping(value = "", method = RequestMethod.GET)
public @ResponseBody Collection<Room> getAll() {
@ResponseBody
public Collection<Room> getAll() {
return roomsDAO.getRooms();
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public @ResponseBody Room getRoomById(@PathVariable("id") int id) {
@ResponseBody
public Room getRoomById(@PathVariable("id") int id) {
return roomsDAO.getRoom(id);
}
@RequestMapping(value = "/{id}/devices", method = RequestMethod.GET)
public @ResponseBody
List<BuntiDevice> getDevicesFromRoom(@PathVariable("id") int id) {
@ResponseBody
public List<BuntiDevice> getDevicesFromRoom(@PathVariable("id") int id) {
Room room = roomsDAO.getRoom(id);
if(room != null) {