source: src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java@ 5444409

Last change on this file since 5444409 was 00fa72f, checked in by DenicaKj <dkorvezir@…>, 21 months ago

Reservation Implemented

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.example.moviezone.service.Impl;
2
3import com.example.moviezone.model.Category;
4import com.example.moviezone.model.Projection_Room;
5import com.example.moviezone.model.Seat;
6import com.example.moviezone.repository.SeatRepository;
7import com.example.moviezone.service.SeatService;
8import org.springframework.stereotype.Service;
9
10import java.util.List;
11import java.util.Optional;
12
13@Service
14public class SeatServiceImpl implements SeatService {
15
16
17 private final SeatRepository seatRepository;
18
19 public SeatServiceImpl(SeatRepository seatRepository) {
20 this.seatRepository = seatRepository;
21 }
22
23 @Override
24 public List<Seat> findAllSeats() {
25 return seatRepository.findAll();
26 }
27
28 @Override
29 public List<Seat> findAllByProjection_Room(Projection_Room projection_room) {
30 return seatRepository.findAllByProjection(projection_room);
31 }
32
33 @Override
34 public List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category) {
35 return seatRepository.findAllByCategoryAndProjection(category,projectionRoom);
36 }
37
38 @Override
39 public Optional<Seat> getSeatById(int id) {
40 return Optional.of(seatRepository.getById(id));
41 }
42}
Note: See TracBrowser for help on using the repository browser.