main
Last change
on this file since ae042f4 was ae042f4, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Configured spring security, changed spring version
|
-
Property mode
set to
100644
|
File size:
726 bytes
|
Rev | Line | |
---|
[feffc2f] | 1 | package com.example.autopartz.service.impl;
|
---|
| 2 |
|
---|
| 3 | import com.example.autopartz.model.Part;
|
---|
| 4 | import com.example.autopartz.repository.PartRepository;
|
---|
| 5 | import com.example.autopartz.service.PartService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | import java.util.List;
|
---|
| 9 |
|
---|
| 10 | @Service
|
---|
| 11 | public class PartServiceImpl implements PartService {
|
---|
| 12 | private final PartRepository partRepository;
|
---|
| 13 |
|
---|
| 14 | public PartServiceImpl(PartRepository partRepository) {
|
---|
| 15 | this.partRepository = partRepository;
|
---|
| 16 | }
|
---|
| 17 |
|
---|
| 18 | @Override
|
---|
| 19 | public List<Part> findAll() {
|
---|
| 20 | return partRepository.findAll();
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | @Override
|
---|
[ae042f4] | 24 | public Part findById(Integer id) {
|
---|
[feffc2f] | 25 | return partRepository.findById(id).orElseThrow(RuntimeException::new);
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.