Last change
on this file was ed20c2c, checked in by HumaSejdini <humasejdini12@…>, 2 years ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[ed20c2c] | 1 | package com.example.baza.service.impl;
|
---|
| 2 |
|
---|
| 3 | import com.example.baza.model.Izdavac;
|
---|
| 4 | import com.example.baza.repository.IzdavacRepository;
|
---|
| 5 | import com.example.baza.service.IzdavacService;
|
---|
| 6 | import org.springframework.stereotype.Service;
|
---|
| 7 |
|
---|
| 8 | import java.util.List;
|
---|
| 9 | import java.util.Optional;
|
---|
| 10 |
|
---|
| 11 | @Service
|
---|
| 12 | public class IzdavacServiceImpl implements IzdavacService {
|
---|
| 13 | private final IzdavacRepository izdavacRepository;
|
---|
| 14 |
|
---|
| 15 | public IzdavacServiceImpl(IzdavacRepository izdavacRepository) {
|
---|
| 16 | this.izdavacRepository = izdavacRepository;
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | @Override
|
---|
| 20 | public Optional<Izdavac> findById(Integer id) {
|
---|
| 21 | return this.izdavacRepository.findById(id);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | @Override
|
---|
| 25 | public List<Izdavac> findByimeNaIzdavac(String imeNaIzdavac) {
|
---|
| 26 | return this.izdavacRepository.findByImeNaIzdavac(imeNaIzdavac);
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | @Override
|
---|
| 30 | public Izdavac create(String email, String lokacija, String imeNaIzdavac) {
|
---|
| 31 | return this.izdavacRepository.save(new Izdavac(email,lokacija,imeNaIzdavac));
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | @Override
|
---|
| 35 | public void delete(Integer id) {
|
---|
| 36 | this.izdavacRepository.deleteById(id);
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.