package ink.wgink.service.permission.dao;

import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.interfaces.init.IInitBaseTable;
import ink.wgink.pojo.dtos.permission.PermissionDTO;
import org.springframework.stereotype.Repository;

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

/**
 * @ClassName: IPermissionDao
 * @Description: 权限
 * @Author: WenG
 * @Date: 2020-05-27 15:58
 * @Version: 1.0
 **/
@Repository
public interface IPermissionDao extends IInitBaseTable {

    /**
     * 新增权限
     *
     * @param params
     * @throws SaveException
     */
    void save(Map<String, Object> params) throws SaveException;

    /**
     * 删除权限
     *
     * @param params
     * @throws RemoveException
     */
    void remove(Map<String, Object> params) throws RemoveException;

    /**
     * 删除权限（物理）
     *
     * @param params
     * @throws RemoveException
     */
    void delete(Map<String, Object> params) throws RemoveException;

    /**
     * 修改权限
     *
     * @param params
     * @throws UpdateException
     */
    void update(Map<String, Object> params) throws UpdateException;

    /**
     * 权限详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    PermissionDTO get(Map<String, Object> params) throws SearchException;

    /**
     * 权限列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<PermissionDTO> list(Map<String, Object> params) throws SearchException;

    /**
     * 权限统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer count(Map<String, Object> params) throws SearchException;

}