package com.yonge.cooleshow.biz.dal.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yonge.cooleshow.biz.dal.dao.ImUserFriendDao;
import com.yonge.cooleshow.biz.dal.entity.ImUserFriend;
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
import com.yonge.cooleshow.biz.dal.enums.im.EImUserFriendSourceForm;
import com.yonge.cooleshow.biz.dal.vo.im.ImUserFriendVO;
import com.yonge.cooleshow.biz.dal.wrapper.im.CustomerService;
import com.yonge.cooleshow.biz.dal.wrapper.im.ImUserWrapper;

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

/**
 * 用户通讯录表(ImUserFriend)表服务接口
 *
 * @author zx
 * @since 2022-03-22 10:46:00
 */
public interface ImUserFriendService extends IService<ImUserFriend> {

    ImUserFriendDao getDao();

    /**
    * @description: 保存用户通讯录
     * @param teacherId
     * @param studentIds
    * @return void
    * @author zx
    * @date 2022/3/24 10:06
    */
    void saveUserFriend(Long teacherId, Set<Long> studentIds, EImUserFriendSourceForm sourceForm);

    void saveUserTeacherFriend(Long teacherId, Set<Long> teacherIds, EImUserFriendSourceForm sourceForm);

    /**
    * @description: 获取用户详情
     * @param userId
    * @return com.yonge.cooleshow.biz.dal.entity.ImUserFriend
    * @author zx
    * @date 2022/3/24 12:03
    */
    ImUserFriendVO.ImUserFriend getDetail(String userId, ClientEnum clientType);

    /**
     * 获取用户详情
     * @param userId 用户ID
     * @return ImUserFriend
     */
    ImUserFriend getImUserProfile(String userId);

    /**
     * 新用户自动添加客服
     * @param userId 新用户ID
     * @param friendIds 好友ID
     * @param clientType 客户端类型
     * @return Integer
     */
    Integer registerUserBindCustomerService(Long userId, List<Long> friendIds, ClientEnum clientType);

    void sendCustomerServiceAddFriendMessage(Long customerServiceId, String sendTitle, String sendMessage, List<Long> friendIds, ClientEnum friendType);

    /**
     * 发送系统客服消息
     * @param sender 发送者
     * @param info CustomerService.NotifyMessage
     */
    void sendCustomerServiceNotifyMessage(String sender, CustomerService.NotifyMessage info);

    /**
     * 用户IM好友列表
     * @param clientType 客户端类型
     * @param userId 用户ID
     * @param paramMap Map<String, Object>
     * @return List<ImUserWrapper.ImUserFriend>
     */
    List<ImUserWrapper.ImUserFriend> findUserAllImFriendInfo(ClientEnum clientType, Long userId, Map<String, Object> paramMap);

    void delTeacherFriendByTenantId(Long tenantId, Long userId, String clientType);

    void delStudentFriendByTenantId(Long tenantId, Long userId, String clientType);

    void refreshCustomer(Long userId, ClientEnum userClientType, List<Long> friendIds, ClientEnum friendClientType);

    ImUserFriendVO.ImMessageUser getImMessageUser(String imUserId);
}

