package ink.wgink.login.base.dao.config;

import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.login.base.pojo.dtos.config.ConfigDTO;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IConfigService
 * @Description: 系统配置
 * @Author: WangGeng
 * @Date: 2019/11/20 10:33
 * @Version: 1.0
 **/
@Repository
public interface IConfigDao extends IInitBaseTable {

    /**
     * 保存配置
     *
     * @param configParams
     * @throws SaveException
     */
    void save(Map<String, Object> configParams) throws SaveException;

    /**
     * 更新配置
     *
     * @param configParams
     * @throws UpdateException
     */
    void update(Map<String, Object> configParams) throws UpdateException;

    /**
     * 配置列表
     *
     * @return
     * @throws SearchException
     */
    List<ConfigDTO> list() throws SearchException;

    /**
     * 配置详情
     *
     * @param key
     * @return
     * @throws SearchException
     */
    ConfigDTO get(String key) throws SearchException;

}
