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

import cn.reghao.autodop.dmaster.app.db.crud.config.AppConfigCrud;
import cn.reghao.autodop.dmaster.app.db.repository.config.AppConfigRepository;
import cn.reghao.autodop.dmaster.app.model.po.config.AppConfig;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author reghao
 * @date 2020-11-10 21:58:00
 */
@Service
public class AppConfigCrudImpl implements AppConfigCrud {
    private final AppConfigRepository appRepository;

    public AppConfigCrudImpl(AppConfigRepository appRepository) {
        this.appRepository = appRepository;
    }

    @Override
    public AppConfig save(AppConfig appConfig) {
        appRepository.save(appConfig);
        return appConfig;
    }

    @Override
    public void saveAll(List<AppConfig> list) {
        appRepository.saveAll(list);
    }

    @Override
    public void update(AppConfig appConfig) {
        appRepository.save(appConfig);
    }

    @Override
    public void delete(AppConfig appConfig) {
        appRepository.delete(appConfig);
    }
}
