package cn.reghao.autodop.dmaster.machine.db.crud;

import cn.reghao.autodop.dmaster.machine.db.repository.NodeLogRepository;
import cn.reghao.autodop.dmaster.machine.model.po.NodeLog;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2021-09-15 15:10:06
 */
@Service
public class NodeLogCrudImpl implements NodeLogCrud {
    private final NodeLogRepository nodeLogRepository;

    public NodeLogCrudImpl(NodeLogRepository nodeLogRepository) {
        this.nodeLogRepository = nodeLogRepository;
    }

    @Override
    public NodeLog save(NodeLog nodeLog) {
        nodeLogRepository.save(nodeLog);
        return nodeLog;
    }

    @Override
    public void saveAll(List<NodeLog> menus) {
        nodeLogRepository.saveAll(menus);
    }

    @Override
    public void update(NodeLog nodeLog) {
        nodeLogRepository.save(nodeLog);
    }

    @Override
    public void delete(NodeLog nodeLog) {
        nodeLogRepository.delete(nodeLog);
    }
}
