Changeset 501396e for src/main/java/com/example/cookbook/service/impl
- Timestamp:
- 02/03/24 15:58:58 (9 months ago)
- Branches:
- master
- Children:
- aea04dd
- Parents:
- 3e572eb
- Location:
- src/main/java/com/example/cookbook/service/impl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/cookbook/service/impl/ReceptServiceImpl.java
r3e572eb r501396e 1 package com.example.cookbook.service.impl;public class ReceptServiceImpl { 1 package com.example.cookbook.service.impl; 2 3 import com.example.cookbook.model.Recept; 4 import com.example.cookbook.model.exception.ReceptNeEPronajdenException; 5 import com.example.cookbook.repository.ReceptRepository; 6 import com.example.cookbook.service.ReceptService; 7 import org.springframework.stereotype.Service; 8 9 import java.sql.SQLException; 10 import java.util.List; 11 import java.util.Optional; 12 13 @Service 14 public class ReceptServiceImpl implements ReceptService { 15 16 private final ReceptRepository receptRepository; 17 18 public ReceptServiceImpl(ReceptRepository receptRepository) { 19 this.receptRepository = receptRepository; 20 } 21 22 @Override 23 public List<Recept> listAll() throws SQLException { 24 return receptRepository.findAll(); 25 } 26 27 @Override 28 public Recept findById(Long id) throws SQLException { 29 Recept recept; 30 31 recept = receptRepository.findById(id).orElseThrow(ReceptNeEPronajdenException::new); 32 33 return recept; 34 } 2 35 } -
src/main/java/com/example/cookbook/service/impl/SlikiServiceImpl.java
r3e572eb r501396e 1 package com.example.cookbook.service.impl;public class SlikiService { 1 package com.example.cookbook.service.impl; 2 3 4 import com.example.cookbook.model.Slika; 5 import com.example.cookbook.repository.SlikiZaReceptRepository; 6 import com.example.cookbook.service.SlikiService; 7 import org.springframework.stereotype.Service; 8 9 import java.sql.SQLException; 10 import java.util.List; 11 12 @Service 13 public class SlikiServiceImpl implements SlikiService { 14 15 private final SlikiZaReceptRepository slikiZaReceptRepository; 16 17 public SlikiServiceImpl(SlikiZaReceptRepository slikiZaReceptRepository) { 18 this.slikiZaReceptRepository = slikiZaReceptRepository; 19 } 20 21 @Override 22 public List<Slika> findAllPicById(Long recId) throws SQLException { 23 return slikiZaReceptRepository.findAllForRecipe(recId); 24 } 2 25 } -
src/main/java/com/example/cookbook/service/impl/SostojkiServiceImpl.java
r3e572eb r501396e 1 package com.example.cookbook.service.impl;public class SostojkiServiceImpl { 1 package com.example.cookbook.service.impl; 2 3 4 import com.example.cookbook.model.Sostojka; 5 import com.example.cookbook.repository.SostojkiRespository; 6 import com.example.cookbook.service.SostojkiService; 7 import org.springframework.stereotype.Service; 8 9 import java.sql.SQLException; 10 import java.util.List; 11 12 @Service 13 public class SostojkiServiceImpl implements SostojkiService { 14 15 private final SostojkiRespository sostojkiRepository; 16 17 public SostojkiServiceImpl(SostojkiRespository sostojkiRepository) { 18 this.sostojkiRepository = sostojkiRepository; 19 } 20 21 @Override 22 public List<Sostojka> findAllById(Long rId) throws SQLException { 23 return sostojkiRepository.findAllByRId(rId); 24 } 2 25 }
Note:
See TracChangeset
for help on using the changeset viewer.