source: src/main/java/com/project/beautycenter/service/impl/BeautyCenterServiceImpl.java

Last change on this file was 850b344, checked in by Tamara Simikj <tamara.simic12@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 879 bytes
Line 
1package com.project.beautycenter.service.impl;
2
3import com.project.beautycenter.model.Beautycenter;
4import com.project.beautycenter.repository.BeautyCenterRepository;
5import com.project.beautycenter.service.BeautyCenterService;
6import org.springframework.stereotype.Service;
7
8import java.util.List;
9
10@Service
11public class BeautyCenterServiceImpl implements BeautyCenterService {
12 private final BeautyCenterRepository beautyCenterRepository;
13
14 public BeautyCenterServiceImpl(BeautyCenterRepository beautyCenterRepository) {
15 this.beautyCenterRepository = beautyCenterRepository;
16 }
17
18 @Override
19 public List<Beautycenter> listAll() {
20 return this.beautyCenterRepository.findAll();
21 }
22
23 @Override
24 public Beautycenter findById(String Id) {
25 return this.beautyCenterRepository.findById(Id).orElseThrow(NullPointerException::new);
26 }
27}
Note: See TracBrowser for help on using the repository browser.