Last change
on this file since 86e187f was 3242ef4, checked in by milamihajlovska <mila.mihajlovska01@…>, 22 months ago |
ticket service save method
|
-
Property mode
set to
100644
|
File size:
955 bytes
|
Line | |
---|
1 | package com.example.moviezone.service.Impl;
|
---|
2 |
|
---|
3 | import com.example.moviezone.model.Customer;
|
---|
4 | import com.example.moviezone.model.Ticket;
|
---|
5 | import com.example.moviezone.repository.TicketRepository;
|
---|
6 | import com.example.moviezone.service.TicketService;
|
---|
7 | import org.springframework.stereotype.Service;
|
---|
8 |
|
---|
9 | import java.util.List;
|
---|
10 |
|
---|
11 | @Service
|
---|
12 | public class TicketServiceImpl implements TicketService {
|
---|
13 | private final TicketRepository ticketRepository;
|
---|
14 |
|
---|
15 | public TicketServiceImpl(TicketRepository ticketRepository) {
|
---|
16 | this.ticketRepository = ticketRepository;
|
---|
17 | }
|
---|
18 |
|
---|
19 | @Override
|
---|
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);
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Override
|
---|
30 | public Ticket save(long price, Customer customer) {
|
---|
31 | return ticketRepository.save(new Ticket(price,customer));
|
---|
32 | }
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.