source: src/main/java/com/example/villadihovo/service/impl/offers/RoomsServiceImpl.java

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 
1package com.example.villadihovo.service.impl.offers;
2
3import com.example.villadihovo.model.offers.Rooms;
4import com.example.villadihovo.repository.offers.RoomRepository;
5import com.example.villadihovo.service.offers.RoomsService;
6import org.springframework.beans.factory.annotation.Autowired;
7import org.springframework.stereotype.Service;
8
9import java.util.List;
10import java.util.Optional;
11
12@Service
13public 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.