Last change
on this file was 01a1ca6, checked in by DenicaKj <dkorvezir@…>, 21 months ago |
added authorization
|
-
Property mode
set to
100644
|
File size:
938 bytes
|
Rev | Line | |
---|
[11dea8f] | 1 | package com.example.moviezone.service.Impl;
|
---|
| 2 |
|
---|
| 3 | import com.example.moviezone.model.Customer;
|
---|
[1b248e4] | 4 | import com.example.moviezone.repository.CustomerRepository;
|
---|
[11dea8f] | 5 | import com.example.moviezone.service.CustomerService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | import java.util.List;
|
---|
[00fa72f] | 9 | import java.util.Optional;
|
---|
[11dea8f] | 10 |
|
---|
| 11 | @Service
|
---|
| 12 | public class CustomerServiceImpl implements CustomerService {
|
---|
[1b248e4] | 13 | private final CustomerRepository customerRepository;
|
---|
| 14 |
|
---|
| 15 | public CustomerServiceImpl(CustomerRepository customerRepository) {
|
---|
| 16 | this.customerRepository = customerRepository;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
[11dea8f] | 19 | @Override
|
---|
| 20 | public List<Customer> findAllCustomers() {
|
---|
[1b248e4] | 21 | return customerRepository.findAll();
|
---|
[11dea8f] | 22 | }
|
---|
[00fa72f] | 23 |
|
---|
| 24 | @Override
|
---|
| 25 | public Optional<Customer> getCustomerById(int id) {
|
---|
| 26 | return customerRepository.findById(id);
|
---|
| 27 | }
|
---|
[01a1ca6] | 28 |
|
---|
| 29 | @Override
|
---|
| 30 | public Customer findByUsername(String username) {
|
---|
| 31 | return customerRepository.getByUsername(username);
|
---|
| 32 | }
|
---|
[11dea8f] | 33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.