package com.cm.central.control.dao.client;

import com.cm.central.control.pojo.bos.ClientBO;
import com.cm.central.control.pojo.dtos.client.ClientLicenseAuthorizationDTO;
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.result.SuccessResultList;
import com.cm.central.control.pojo.dtos.client.ClientDTO;
import org.springframework.stereotype.Repository;

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

/**
 * @ClassName: IClientDao
 * @Description: 客户端
 * @Author: WenG
 * @Date: 2020-07-30 19:12
 * @Version: 1.0
 **/
@Repository
public interface IClientDao {

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

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

    /**
     * 删除客户端（物理）
     *
     * @param params
     * @throws RemoveException
     */
    void deleteClient(Map<String, Object> params) throws RemoveException;

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

    /**
     * 更新客户端授权
     *
     * @param params
     * @throws UpdateException
     */
    void updateClientLicense(Map<String, Object> params) throws UpdateException;

    /**
     * 客户端详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    ClientDTO getClient(Map<String, Object> params) throws SearchException;

    /**
     * 客户端列表
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<ClientDTO> listClient(Map<String, Object> params) throws SearchException;

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

    /**
     * 获取客户端密码
     *
     * @param clientId
     * @return
     * @throws SearchException
     */
    String getClientSecretByClientId(String clientId) throws SearchException;

    /**
     * 客户端license授权(通过ID)
     *
     * @param clientId
     * @return
     * @throws SearchException
     */
    ClientLicenseAuthorizationDTO getClientLicenseAuthorizationByClientId(String clientId) throws SearchException;

    /**
     * 获取client详情
     * @param params
     * @return
     * @throws SearchException
     */
    ClientBO getClientBO(Map<String, Object> params) throws SearchException;
}