Last change
on this file was f7c05a1, checked in by Elena Shulevska <elena.shulevska@…>, 15 months ago |
initial commit of the source code on origin
|
-
Property mode
set to
100644
|
File size:
850 bytes
|
Line | |
---|
1 | package com.example.villadihovo.service.impl.offers;
|
---|
2 |
|
---|
3 | import com.example.villadihovo.model.offers.Rooms;
|
---|
4 | import com.example.villadihovo.repository.offers.RoomRepository;
|
---|
5 | import com.example.villadihovo.service.offers.RoomsService;
|
---|
6 | import org.springframework.beans.factory.annotation.Autowired;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 | import java.util.Optional;
|
---|
11 |
|
---|
12 | @Service
|
---|
13 | public class RoomsServiceImpl implements RoomsService {
|
---|
14 | @Autowired
|
---|
15 | RoomRepository roomRepository;
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public List<Rooms> getAvailableRooms() {
|
---|
19 | return roomRepository.findAllByAvailabilityTrue();
|
---|
20 | }
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | public List<Rooms> findAll() {
|
---|
24 | return roomRepository.findAll();
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public Optional<Rooms> findRoomById(Integer id) {
|
---|
29 | return roomRepository.findById(id);
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.