Changeset 1b248e4
- Timestamp:
- 02/02/23 22:46:30 (23 months ago)
- Branches:
- master
- Children:
- ac25203
- Parents:
- f60cb20
- Location:
- src/main/java/com/example/moviezone
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/repository/TicketRepository.java
rf60cb20 r1b248e4 1 1 package com.example.moviezone.repository; 2 2 3 import com.example.moviezone.model.Customer; 3 4 import com.example.moviezone.model.Ticket; 4 5 import org.springframework.data.jpa.repository.JpaRepository; 5 6 7 import java.util.List; 8 6 9 public interface TicketRepository extends JpaRepository<Ticket,Integer> { 10 List<Ticket> findAllByCustomer(Customer customer); 7 11 } -
src/main/java/com/example/moviezone/service/Impl/CinemaServiceImpl.java
rf60cb20 r1b248e4 18 18 @Override 19 19 public List<Cinema> findAllCinemas() { 20 return null;20 return cinemaRepository.findAll(); 21 21 } 22 22 } -
src/main/java/com/example/moviezone/service/Impl/CustomerServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.Customer; 4 import com.example.moviezone.repository.CustomerRepository; 4 5 import com.example.moviezone.service.CustomerService; 5 6 import org.springframework.stereotype.Service; … … 9 10 @Service 10 11 public class CustomerServiceImpl implements CustomerService { 12 private final CustomerRepository customerRepository; 13 14 public CustomerServiceImpl(CustomerRepository customerRepository) { 15 this.customerRepository = customerRepository; 16 } 17 11 18 @Override 12 19 public List<Customer> findAllCustomers() { 13 return null;20 return customerRepository.findAll(); 14 21 } 15 22 } -
src/main/java/com/example/moviezone/service/Impl/EventServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.Event; 4 import com.example.moviezone.repository.EventRepository; 4 5 import com.example.moviezone.service.EventService; 5 6 import org.springframework.stereotype.Service; … … 9 10 @Service 10 11 public class EventServiceImpl implements EventService { 12 private final EventRepository eventRepository; 13 14 public EventServiceImpl(EventRepository eventRepository) { 15 this.eventRepository = eventRepository; 16 } 17 11 18 @Override 12 19 public List<Event> findAllEvents() { 13 return null;20 return eventRepository.findAll(); 14 21 } 15 22 } -
src/main/java/com/example/moviezone/service/Impl/FilmServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.Film; 4 import com.example.moviezone.repository.FilmRepository; 4 5 import com.example.moviezone.service.FilmService; 5 6 import org.springframework.stereotype.Service; … … 9 10 @Service 10 11 public class FilmServiceImpl implements FilmService { 12 private final FilmRepository filmRepository; 13 14 public FilmServiceImpl(FilmRepository filmRepository) { 15 this.filmRepository = filmRepository; 16 } 17 11 18 @Override 12 19 public List<Film> findAllFilms() { 13 return null;20 return filmRepository.findAll(); 14 21 } 15 22 } -
src/main/java/com/example/moviezone/service/Impl/ProjectionServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.Projection; 4 import com.example.moviezone.repository.ProjectionRepository; 4 5 import com.example.moviezone.service.ProjectionService; 5 6 import org.springframework.stereotype.Service; … … 9 10 @Service 10 11 public class ProjectionServiceImpl implements ProjectionService { 12 private final ProjectionRepository projectionRepository; 13 14 public ProjectionServiceImpl(ProjectionRepository projectionRepository) { 15 this.projectionRepository = projectionRepository; 16 } 17 11 18 @Override 12 19 public List<Projection> findAllProjections() { 13 return null;20 return projectionRepository.findAll(); 14 21 } 15 22 } -
src/main/java/com/example/moviezone/service/Impl/Projection_RoomServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.Projection_Room; 4 import com.example.moviezone.repository.Projection_RoomRepository; 4 5 import com.example.moviezone.service.Projection_RoomService; 5 6 import org.springframework.stereotype.Service; … … 9 10 @Service 10 11 public class Projection_RoomServiceImpl implements Projection_RoomService { 12 private final Projection_RoomRepository projectionRoomRepository; 13 14 public Projection_RoomServiceImpl(Projection_RoomRepository projectionRoomRepository) { 15 this.projectionRoomRepository = projectionRoomRepository; 16 } 17 11 18 @Override 12 19 public List<Projection_Room> findAllProjectionRooms() { 13 return null;20 return projectionRoomRepository.findAll(); 14 21 } 15 22 } -
src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java
rf60cb20 r1b248e4 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.Customer; 3 4 import com.example.moviezone.model.Ticket; 5 import com.example.moviezone.repository.TicketRepository; 4 6 import com.example.moviezone.service.TicketService; 5 7 import org.springframework.stereotype.Service; … … 9 11 @Service 10 12 public class TicketServiceImpl implements TicketService { 11 @Override 12 public List<Ticket> findAllTickets() { 13 return null; 13 private final TicketRepository ticketRepository; 14 15 public TicketServiceImpl(TicketRepository ticketRepository) { 16 this.ticketRepository = ticketRepository; 14 17 } 15 18 16 19 @Override 17 public List<Ticket> findAllByCustomer() { 18 return null; 20 public List<Ticket> findAllTickets() { 21 return ticketRepository.findAll(); 22 } 23 24 @Override 25 public List<Ticket> findAllByCustomer(Customer customer) { 26 return ticketRepository.findAllByCustomer(customer); 19 27 } 20 28 } -
src/main/java/com/example/moviezone/service/Impl/UserServiceImpl.java
rf60cb20 r1b248e4 2 2 3 3 import com.example.moviezone.model.User; 4 import com.example.moviezone.model.exceptions.UserNotFoundException; 5 import com.example.moviezone.repository.UserRepository; 4 6 import com.example.moviezone.service.UserService; 5 7 import org.springframework.stereotype.Service; … … 10 12 public class UserServiceImpl implements UserService { 11 13 14 private final UserRepository userRepository; 15 16 public UserServiceImpl(UserRepository userRepository) { 17 this.userRepository = userRepository; 18 } 12 19 13 20 @Override 14 21 public List<User> findAllUsers() { 15 return null;22 return userRepository.findAll(); 16 23 } 17 24 18 25 @Override 19 public User findById( ) {20 return null;26 public User findById(Integer id) { 27 return userRepository.findById(id).orElseThrow(UserNotFoundException::new); 21 28 } 22 29 } -
src/main/java/com/example/moviezone/service/TicketService.java
rf60cb20 r1b248e4 1 1 package com.example.moviezone.service; 2 2 3 import com.example.moviezone.model.Customer; 3 4 import com.example.moviezone.model.Ticket; 4 5 … … 7 8 public interface TicketService { 8 9 List<Ticket> findAllTickets(); 9 List<Ticket> findAllByCustomer( );10 List<Ticket> findAllByCustomer(Customer customer); 10 11 } -
src/main/java/com/example/moviezone/service/UserService.java
rf60cb20 r1b248e4 7 7 public interface UserService { 8 8 List<User> findAllUsers(); 9 User findById( );9 User findById(Integer user_id); 10 10 }
Note:
See TracChangeset
for help on using the changeset viewer.