Changeset 00fa72f for src/main/java/com/example/moviezone/service
- Timestamp:
- 02/09/23 14:06:45 (23 months ago)
- Branches:
- master
- Children:
- 6a9006d, a9ffccd
- Parents:
- 0ba5d1a
- Location:
- src/main/java/com/example/moviezone/service
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/moviezone/service/CategoryService.java
r0ba5d1a r00fa72f 4 4 5 5 import java.util.List; 6 import java.util.Optional; 6 7 7 8 public interface CategoryService { 8 9 List<Category> findAllCategories(); 10 Optional<Category> getCategoryById(int id); 9 11 } -
src/main/java/com/example/moviezone/service/CustomerService.java
r0ba5d1a r00fa72f 5 5 6 6 import java.util.List; 7 import java.util.Optional; 8 7 9 @Repository 8 10 public interface CustomerService { 9 11 List<Customer> findAllCustomers(); 12 Optional<Customer> getCustomerById(int id); 10 13 } -
src/main/java/com/example/moviezone/service/Impl/CategoryServiceImpl.java
r0ba5d1a r00fa72f 7 7 8 8 import java.util.List; 9 import java.util.Optional; 9 10 10 11 @Service … … 20 21 return categoryRepository.findAll(); 21 22 } 23 24 @Override 25 public Optional<Category> getCategoryById(int id) { 26 return categoryRepository.getByIdcategory(id); 27 } 22 28 } -
src/main/java/com/example/moviezone/service/Impl/CustomerServiceImpl.java
r0ba5d1a r00fa72f 7 7 8 8 import java.util.List; 9 import java.util.Optional; 9 10 10 11 @Service … … 20 21 return customerRepository.findAll(); 21 22 } 23 24 @Override 25 public Optional<Customer> getCustomerById(int id) { 26 return customerRepository.findById(id); 27 } 22 28 } -
src/main/java/com/example/moviezone/service/Impl/Projection_RoomServiceImpl.java
r0ba5d1a r00fa72f 20 20 return projectionRoomRepository.findAll(); 21 21 } 22 23 @Override 24 public List<Projection_Room> getRoomByProjection(int id) { 25 return projectionRoomRepository.getRoomsForProjection(id); 26 } 22 27 } -
src/main/java/com/example/moviezone/service/Impl/SeatServiceImpl.java
r0ba5d1a r00fa72f 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.Category; 3 4 import com.example.moviezone.model.Projection_Room; 4 5 import com.example.moviezone.model.Seat; … … 8 9 9 10 import java.util.List; 11 import java.util.Optional; 10 12 11 13 @Service 12 14 public class SeatServiceImpl implements SeatService { 15 16 13 17 private final SeatRepository seatRepository; 14 18 … … 26 30 return seatRepository.findAllByProjection(projection_room); 27 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 } 28 42 } -
src/main/java/com/example/moviezone/service/Impl/TicketServiceImpl.java
r0ba5d1a r00fa72f 1 1 package com.example.moviezone.service.Impl; 2 2 3 import com.example.moviezone.model.Customer; 4 import com.example.moviezone.model.Ticket; 3 import com.example.moviezone.model.*; 5 4 import com.example.moviezone.repository.TicketRepository; 6 5 import com.example.moviezone.service.TicketService; 7 6 import org.springframework.stereotype.Service; 8 7 8 import java.time.LocalDate; 9 9 import java.util.List; 10 10 … … 28 28 29 29 @Override 30 public Ticket saveWithDiscount(LocalDate date, Customer customer, Projection projection, Discount discount, Seat seat) { 31 Ticket t=new Ticket(date,customer,projection,discount,seat); 32 return ticketRepository.save(t); 33 } 34 35 @Override 36 public Ticket saveWithout(LocalDate date, Customer customer, Projection projection, Seat seat) { 37 Ticket t=new Ticket(date,customer,projection,seat); 38 return ticketRepository.save(t); 39 } 40 41 @Override 30 42 public Ticket save(long price, Customer customer) { 31 43 return ticketRepository.save(new Ticket(price,customer)); 32 44 } 45 46 @Override 47 public Integer priceForTicket(int id) { 48 return ticketRepository.getPriceForTicket(id); 49 } 33 50 } -
src/main/java/com/example/moviezone/service/Projection_RoomService.java
r0ba5d1a r00fa72f 2 2 3 3 import com.example.moviezone.model.Projection_Room; 4 import org.springframework.data.jpa.repository.query.Procedure; 4 5 5 6 import java.util.List; … … 7 8 public interface Projection_RoomService { 8 9 List<Projection_Room> findAllProjectionRooms(); 10 11 List<Projection_Room> getRoomByProjection(int id); 9 12 } -
src/main/java/com/example/moviezone/service/SeatService.java
r0ba5d1a r00fa72f 1 1 package com.example.moviezone.service; 2 2 3 import com.example.moviezone.model.Category; 3 4 import com.example.moviezone.model.Projection_Room; 4 5 import com.example.moviezone.model.Seat; 5 6 6 7 import java.util.List; 8 import java.util.Optional; 7 9 8 10 public interface SeatService { 9 11 List<Seat> findAllSeats(); 10 12 List<Seat> findAllByProjection_Room(Projection_Room projection_room); 13 List<Seat> findAllByRoomAndCategory(Projection_Room projectionRoom, Category category); 14 Optional<Seat> getSeatById(int id); 11 15 } -
src/main/java/com/example/moviezone/service/TicketService.java
r0ba5d1a r00fa72f 1 1 package com.example.moviezone.service; 2 2 3 import com.example.moviezone.model.Customer; 4 import com.example.moviezone.model.Ticket; 3 import com.example.moviezone.model.*; 5 4 5 import java.time.LocalDate; 6 6 import java.util.List; 7 7 … … 9 9 List<Ticket> findAllTickets(); 10 10 List<Ticket> findAllByCustomer(Customer customer); 11 11 Ticket saveWithDiscount(LocalDate date, Customer customer, Projection projection, Discount discount, Seat seat); 12 Ticket saveWithout(LocalDate date,Customer customer,Projection projection,Seat seat); 12 13 Ticket save(long price,Customer customer); 14 Integer priceForTicket(int id); 13 15 }
Note:
See TracChangeset
for help on using the changeset viewer.