package com.project.beautycenter.service.impl; import com.project.beautycenter.model.Beautycenter; import com.project.beautycenter.repository.BeautyCenterRepository; import com.project.beautycenter.service.BeautyCenterService; import org.springframework.stereotype.Service; import java.util.List; @Service public class BeautyCenterServiceImpl implements BeautyCenterService { private final BeautyCenterRepository beautyCenterRepository; public BeautyCenterServiceImpl(BeautyCenterRepository beautyCenterRepository) { this.beautyCenterRepository = beautyCenterRepository; } @Override public List listAll() { return this.beautyCenterRepository.findAll(); } @Override public Beautycenter findById(String Id) { return this.beautyCenterRepository.findById(Id).orElseThrow(NullPointerException::new); } }