package com.cm.common.plugin.dao.dynamic.config.form;

import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.common.plugin.pojo.dtos.dynamic.config.form.DynamicConfigFormDTO;
import org.springframework.stereotype.Repository;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IDynamicConfigFormDao
 * @Description: 动态配置-表单
 * @Author: WangGeng
 * @Date: 2019/12/7 6:14 下午
 * @Version: 1.0
 **/
@Repository
public interface IDynamicConfigFormDao {
    /**
     * 表单新增
     *
     * @param params
     * @throws SaveException
     */
    void saveForm(Map<String, Object> params) throws SaveException;

    /**
     * 表单删除
     *
     * @param params
     * @throws RemoveException
     */
    void removeForm(Map<String, Object> params) throws RemoveException;

    /**
     * 表单修改
     *
     * @param params
     * @throws UpdateException
     */
    void updateForm(Map<String, Object> params) throws UpdateException;

    /**
     * 修改表单中的表名
     *
     * @param params
     * @throws UpdateException
     */
    void updateFormTableName(Map<String, Object> params) throws UpdateException;

    /**
     * 表单详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    DynamicConfigFormDTO getFormById(Map<String, Object> params) throws SearchException;

    /**
     * 表单全部列表单
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<DynamicConfigFormDTO> listForm(Map<String, Object> params) throws SearchException;

}
