io.smilego.tenant.service.ServiceService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of multi-tenant-spring-boot-starter Show documentation
Show all versions of multi-tenant-spring-boot-starter Show documentation
A application used as an example on how to set up pushing
its components to the Central Repository.
package io.smilego.tenant.service;
import io.smilego.tenant.model.Service;
import io.smilego.tenant.persistence.ServiceRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
public class ServiceService {
protected Logger log = LoggerFactory.getLogger(this.getClass());
@Autowired
private ServiceRepository serviceRepository;
public Service getServiceByName(String name){
return this.serviceRepository.findServiceByName(name)
.orElseThrow(() -> new RuntimeException("Erro ao pesquisar o Service por nome " + name));
}
public List getAllServices(){
return serviceRepository.findAll();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy