package com.ho.user.service;

import com.ho.common.tools.entity.PageVO;
import com.ho.common.tools.entity.SimpleUser;
import com.ho.common.tools.entity.UserDetailRespVO;
import com.ho.common.tools.util.PageResult;
import com.ho.user.api.entity.SysDept;
import com.ho.user.api.entity.SysUser;
import com.ho.user.api.vo.req.OrderUserSelectReqVo;
import com.ho.user.api.vo.req.SysSubDictVO;
import com.ho.user.entity.SysTheme;
import com.ho.user.vo.req.*;
import com.ho.user.vo.resp.SysUserThemeRespVo;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author fancl
 * @desc:
 * @date 2022/8/10
 */
public interface UserService {

    UserDetailRespVO login(LoginReqVO vo, SysUser sysUser);

    //生成SimpleUser对象
    SimpleUser generateSimpleUser(SysUser sysUser, Integer deptId, String token, LoginReqVO loginReqVO);

    void addUser(UserAddReqVO vo);

    String register(RegisterReqVO vo);

//    String refreshToken(String refreshToken,String accessToken);

    void updateUserInfo(UserUpdateReqVO vo, String operationId, String token);

    PageVO<SysUser> pageInfo(UserPageReqVO vo);

    SysUser detailInfo(String userId);

    SysUser getUserByName(String userName);

    //根据用户名模糊匹配
    List<SysUser> getUserListByNameConcat(String userName, Integer groupId);

    SysUser getUserByPhone(String phone);

    PageResult<SysUser> selectUserInfoByDeptIds(int pageNum, int pageSize, List<SysDept> depts, UserPageUserByDeptReqVO vo);


    void logout(String accessToken);

    void updatePwd(UpdatePasswordReqVO vo, String userId, String accessToken);


    void resetPwd(ResetPasswordReqVO vo);

    List<SysUser> getUserListByDeptIds(List<Integer> deptIds);

    //根据部门列表和人员id列表(根据角色过滤后的)获取人员列表
    List<SysUser> getUserListByDeptIdsAndUserIds(List<Integer> deptIds, UserPageUserByDeptReqVO userQuery, Integer groupId);

    void deletedUsers(List<String> userIds, String operationId);


    void setUserOwnRole(String userId, List<Integer> roleIds);

    void setUserOwnPosition(String userId, List<Integer> positionIds);

    //查询用户详情
    UserDetailRespVO getUserDetail(String userId, String loginChannel);


    List<SysUser> selectIds(List<String> userIds);

    UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper,String lang);

    //清除用户缓存
    void removeUserCache(String username, String loginChannel);

    List<SysUser> selectByIds(List<String> userIdsByPostIds, OrderUserSelectReqVo vo);

    SysUser selectById(String userId);

    List<SysUser> selectByDeptId(Integer deptId);

    List<SysUser> selectByDeptIds(List<Integer> deptIds);

    /**
     * 筛选特殊用户
     * @return
     */
    Map<String,String> checkSpecialUser();

    /**
     * 根据类型获对应的字典
     * @return
     */
    Map<String, String> getSysSubDict(SysSubDictVO vo);


    /**
     * 根据id查询用户带有岗位
     * @param userIds
     * @param postIds
     * @return
     */
    List<SysUser> selectPostUserIds(List<String> userIds,List<Integer> postIds);


    SysUserThemeRespVo getUserTheme(String userId);

    List<SysTheme> getSysTheme();

    void addUserTheme(SysUserThemeReqVo sysUserThemeReqVo);
}
