Last change
on this file since a8b6e6a was 00fa72f, checked in by DenicaKj <dkorvezir@…>, 22 months ago |
Reservation Implemented
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | package com.example.moviezone.service.Impl;
|
---|
2 |
|
---|
3 | import com.example.moviezone.model.Category;
|
---|
4 | import com.example.moviezone.model.Projection_Room;
|
---|
5 | import com.example.moviezone.model.Seat;
|
---|
6 | import com.example.moviezone.repository.SeatRepository;
|
---|
7 | import com.example.moviezone.service.SeatService;
|
---|
8 | import org.springframework.stereotype.Service;
|
---|
9 |
|
---|
10 | import java.util.List;
|
---|
11 | import java.util.Optional;
|
---|
12 |
|
---|
13 | @Service
|
---|
14 | public 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.