All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smilego.tenant.service.ServiceService Maven / Gradle / Ivy

Go to download

A application used as an example on how to set up pushing its components to the Central Repository.

There is a newer version: 1.2.5
Show newest version
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