package ink.wgink.service.user.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.user.UserDTO;
import ink.wgink.service.user.pojo.pos.UserPO;
import org.springframework.stereotype.Repository;

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

/**
 * When you feel like quitting. Think about why you started
 * 当你想要放弃的时候，想想当初你为何开始
 *
 * @ClassName: IUserDao
 * @Description: 用户
 * @Author: WangGeng
 * @Date: 2021/1/24 20:23
 * @Version: 1.0
 **/
@Repository
public interface IUserDao 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
     * @throws UpdateException
     */
    void updatePassword(Map<String, Object> params) throws UpdateException;

    /**
     * 修改用户名
     *
     * @param params
     * @throws UpdateException
     */
    void updateUsername(Map<String, Object> params) throws UpdateException;

    /**
     * 更新过期时间
     *
     * @param params
     * @throws UpdateException
     */
    void updateExpiredDate(Map<String, Object> params) throws UpdateException;

    /**
     * 更新登录信息
     *
     * @param params
     * @throws UpdateException
     */
    void updateLoginInfo(Map<String, Object> params) throws UpdateException;

    /**
     * 更新用户状态
     *
     * @param params
     * @throws UpdateException
     */
    void updateUserState(Map<String, Object> params) throws UpdateException;

    /**
     * 详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    UserPO getPO(Map<String, Object> params) throws SearchException;

    /**
     * 详情
     *
     * @param params
     * @return
     * @throws SearchException
     */
    List<UserPO> listPO(Map<String, Object> params) throws SearchException;

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

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

    /**
     * 总数
     *
     * @param params
     * @return
     * @throws SearchException
     */
    Integer count(Map<String, Object> params) throws SearchException;

    /**
     * 密码修改时间
     *
     * @param userId
     * @return
     * @throws SearchException
     */
    String getGmtPasswordModified(String userId) throws SearchException;

}
