package ink.wgink.module.oauth.client.service;

import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.dtos.oauth.client.OauthClientDTO;
import ink.wgink.pojo.dtos.oauth.client.OauthClientSimpleDTO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map;

/**
 * @ClassName: IOauthClientService
 * @Description: Oauth客户端
 * @Author: WangGeng
 * @Date: 2019/3/12 11:40 AM
 * @Version: 1.0
 **/
public interface IOauthClientService {

    /**
     * 客户端加密规则
     */
    String OAUTH_CLIENT_RULE = "CMXX_CLIENT";
    String OAUTH_CLIENT_ENVIRONMENT_FORMAL = "formal";
    String OAUTH_CLIENT_ENVIRONMENT_TEST = "test";
    String OAUTH_CLIENT_SYSTEM_TYPE_WITHIN = "within";
    String OAUTH_CLIENT_SYSTEM_TYPE_THIRD = "third";
    String OAUTH_CLIENT_SYSTEM_STATE_NORMAL = "normal";
    String OAUTH_CLIENT_SYSTEM_STATE_LOCKING = "locking";

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

    /**
     * Oauth客户端修改
     *
     * @param params
     * @return
     */
    SuccessResult remove(Map<String, Object> params);

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

    /**
     * easyUI Oauth客户端列表
     *
     * @param page
     * @return
     */
    SuccessResultList<List<OauthClientDTO>> listPage(ListPage page);

    /**
     * Oauth客户端列表
     *
     * @param params
     * @return
     */
    List<OauthClientDTO> list(Map<String, Object> params);

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

    /**
     * Oauth客户端详情
     *
     * @param params
     * @return
     */
    OauthClientDTO get(Map<String, Object> params) throws UnsupportedEncodingException;

    /**
     * Oauth客户端初始化信息
     *
     * @param params
     * @return
     */
    OauthClientDTO getInitClient(Map<String, Object> params) throws UnsupportedEncodingException;

    /**
     * Oauth客户端更新菜单
     *
     * @param params
     * @return
     */
    SuccessResult updateOauthClientMenu(Map<String, Object> params);

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

    /**
     * 清空Oauth客户端菜单
     *
     * @param params
     * @return
     */
    SuccessResult updateClientMenuEmpty(Map<String, Object> params);

    /**
     * 获取Oauth
     *
     * @param clientId
     * @return
     */
    OauthClientDTO getSimple(String clientId);

}
