source: src/main/java/com/example/autopartz/service/impl/CarServiceImpl.java

main
Last change on this file was f484b14, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 23 months ago

Added full functionality for creating order

  • Property mode set to 100644
File size: 681 bytes
Line 
1package com.example.autopartz.service.impl;
2
3import com.example.autopartz.model.Car;
4import com.example.autopartz.repository.CarRepository;
5import com.example.autopartz.service.CarService;
6import org.springframework.stereotype.Service;
7
8import java.util.List;
9
10@Service
11public 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 }
22
23 @Override
24 public Car findById(Integer id) {
25 return carRepository.findById(id).get();
26 }
27}
Note: See TracBrowser for help on using the repository browser.