main
Last change
on this file was f484b14, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Added full functionality for creating order
|
-
Property mode
set to
100644
|
File size:
681 bytes
|
Rev | Line | |
---|
[60de3eb] | 1 | package com.example.autopartz.service.impl;
|
---|
| 2 |
|
---|
| 3 | import com.example.autopartz.model.Car;
|
---|
| 4 | import com.example.autopartz.repository.CarRepository;
|
---|
| 5 | import com.example.autopartz.service.CarService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | import java.util.List;
|
---|
| 9 |
|
---|
| 10 | @Service
|
---|
| 11 | public class CarServiceImpl implements CarService {
|
---|
| 12 | private final CarRepository carRepository;
|
---|
| 13 |
|
---|
| 14 | public CarServiceImpl(CarRepository carRepository) {
|
---|
| 15 | this.carRepository = carRepository;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | @Override
|
---|
| 19 | public List<Car> findAll() {
|
---|
| 20 | return carRepository.findAll();
|
---|
| 21 | }
|
---|
[f484b14] | 22 |
|
---|
| 23 | @Override
|
---|
| 24 | public Car findById(Integer id) {
|
---|
| 25 | return carRepository.findById(id).get();
|
---|
| 26 | }
|
---|
[60de3eb] | 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.