package cn.reghao.autodop.dmaster.app.db.crud.config.impl;

import cn.reghao.autodop.dmaster.app.db.crud.config.PackerConfigCrud;
import cn.reghao.autodop.dmaster.app.db.repository.config.build.PackerConfigRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.build.PackerConfig;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2020-11-10 21:58:00
 */
@Service
public class PackerConfigCrudImpl implements PackerConfigCrud {
    private final PackerConfigRepository packerRepository;

    public PackerConfigCrudImpl(PackerConfigRepository packerRepository) {
        this.packerRepository = packerRepository;
    }

    @Override
    public PackerConfig save(PackerConfig packerConfig) {
        packerRepository.save(packerConfig);
        return packerConfig;
    }

    @Override
    public void saveAll(List<PackerConfig> list) {
        packerRepository.saveAll(list);
    }

    @Override
    public void update(PackerConfig packerConfig) {
        packerRepository.save(packerConfig);
    }

    @Override
    public void delete(PackerConfig packerConfig) {
        packerRepository.delete(packerConfig);
    }
}
