package ink.wgink.login.oauth2.server.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.login.oauth2.server.pojo.dtos.OAuth2ClientDTO;
import ink.wgink.login.oauth2.server.pojo.dtos.OAuth2ClientSimpleDTO;
import ink.wgink.login.oauth2.server.pojo.pos.OAuth2ClientPO;
import org.springframework.stereotype.Repository;

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

/**
 * @ClassName: IOauthClientDao
 * @Description: Oauth客户端
 * @Author: WangGeng
 * @Date: 2019/3/12 11:42 AM
 * @Version: 1.0
 **/
@Repository
public interface IOAuth2ClientDao extends IInitBaseTable {

    /**
     * Oauth客户端新增
     *
     * @param params
     * @throws SaveException
     */
    void save(Map<String, Object> params) throws SaveException;

    /**
     * Oauth客户端删除
     *
     * @param params
     * @throws RemoveException
     */
    void remove(Map<String, Object> params) throws RemoveException;

    /**
     * Oauth客户端修改
     *
     * @param params
     * @throws UpdateException
     */
    void update(Map<String, Object> params) throws UpdateException;

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

    /**
     * Oauth客户端列表（简单）
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<OAuth2ClientSimpleDTO> listSimple(Map<String, Object> params) throws SearchException;

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

    /**
     * 获取Oauth客户端（单表）
     *
     * @param params
     * @return
     * @throws SearchException
     */
    OAuth2ClientPO getPO(Map<String, Object> params) throws SearchException;

    /**
     * Oauth客户端统计
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer count(Map<String, Object> params) throws SearchException;

    /**
     * 更新菜单
     *
     * @param params
     * @throws UpdateException
     */
    void updateMenu(Map<String, Object> params) throws UpdateException;

}
