package com.weavi.service;

import com.weavi.entity.Interface;
import com.weavi.repository.InterfaceRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
public class InterfaceService {
    @Autowired
    InterfaceRepository interfaceRepository;

    public Interface findById(int id){
        return  interfaceRepository.findOne(id);
    }

    public List<Interface> findAll(){
        return interfaceRepository.findAll();
    }

    @Transactional
    public Interface save(Interface in){
        return interfaceRepository.save(in);
    }
}
