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

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 org.springframework.stereotype.Repository;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IDynamicDataDao
 * @Description: 动态数据
 * @Author: WangGeng
 * @Date: 2019/12/4 16:38
 * @Version: 1.0
 **/
@Repository
public interface IDynamicDataDao {

    /**
     * 新增动态数据
     *
     * @param params
     * @return
     * @throws SaveException
     */
    void saveDynamicData(Map<String, Object> params) throws SaveException;

    /**
     * 删除动态数据
     *
     * @param params
     * @return
     * @throws RemoveException
     */
    void removeDynamicData(Map<String, Object> params) throws RemoveException;

    /**
     * 修改动态数据
     *
     * @param params
     * @throws UpdateException
     */
    void updateDynamicData(Map<String, Object> params) throws UpdateException;

    /**
     * 修改动态数据（链接）
     *
     * @param params
     * @throws UpdateException
     */
    void updateDynamicJoinData(Map<String, Object> params) throws UpdateException;

    /**
     * 动态数据列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<Map<String, Object>> listDynamicData(Map<String, Object> params) throws SearchException;

    /**
     * 动态数据详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Map<String, Object> getDynamicData(Map<String, Object> params) throws SearchException;

    /**
     * 动态数据（链接）详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Map<String, Object> getDynamicJoinData(Map<String, Object> params) throws SearchException;

    /**
     * 动态数据（链接）列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<Map<String, Object>> listDynamicJoinData(Map<String, Object> params) throws SearchException;
}
