package com.crm.manager.service;

import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
import com.crm.rely.backend.core.dto.user.info.SalesInfoDropdownDto;
import com.crm.rely.backend.model.dto.user.info.UserInfoSearchDto;
import com.crm.rely.backend.core.exception.ServiceException;
import com.crm.rely.backend.model.entity.custom.info.CustomInfoUpdateAgentEntity;
import com.crm.rely.backend.model.pojo.table.CustomInfoTable;
import com.crm.rely.backend.model.pojo.table.UserInfoTable;
import com.crm.rely.backend.model.entity.user.info.*;

import java.util.List;

/**
 * @program: crm-backend
 * @description:
 * @author: houn
 * @create: 2019-07-25 16:12
 */
public interface UserInfoService {

    /**
     * 用户登录
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    UserInfoEntity login(UserLoginEntity entity) throws ServiceException;

    /**
     * 添加用户信息
     *
     * @param entity
     * @throws ServiceException
     */
    void add(UserInfoAddEntity entity) throws ServiceException, InterruptedException;

    UserInfoTable add(CustomInfoTable customInfoTable) throws ServiceException;

    /**
     * 删除用户
     *
     * @param entity
     * @throws ServiceException
     */
    void delete(UserInfoDeleteEntity entity) throws ServiceException;

    /**
     * 修改用户信息
     *
     * @param entity
     * @throws ServiceException
     */
    UserInfoTable update(UserInfoUpdateEntity entity) throws ServiceException;

    /**
     * 根据条件搜索列表
     *
     * @param entity
     * @return
     * @throws ServiceException
     */
    BaseResultWithPagerDto searchPage(UserInfoSearchEntity entity) throws ServiceException;

    /**
     * 根据id查询
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    UserInfoSearchDto searchSingle(Long id) throws ServiceException;

    void updateLang(UserInfoUpdateLangEntity entity) throws ServiceException;

    void updatePasswordSendEmail(UserUpdatePasswordSendEmailEntity entity) throws ServiceException;

    void updatePassword(UserUpdateEmailPasswordEntity entity) throws ServiceException;

    void updatePassword(UserUpdateLoginPasswordEntity entity) throws ServiceException;


    BaseResultDto<List<SalesInfoDropdownDto>> getSalesInfoDropdown() throws Exception;

    CustomInfoUpdateAgentEntity getAgent(CustomInfoUpdateAgentEntity entity) throws ServiceException;

    BaseResultDto<List<SalesInfoDropdownDto>> getAgentDropdown() throws Exception;

}
