package com.red.circle.other.app.service.user.relation;

import com.red.circle.common.business.dto.cmd.RoomIdCmd;
import com.red.circle.common.business.dto.cmd.app.AppAccountCmd;
import com.red.circle.common.business.dto.cmd.app.AppFlowCmd;
import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
import com.red.circle.common.business.dto.cmd.app.AppUserIdCmd;
import com.red.circle.other.app.command.user.FriendRemoveCmdExe;
import com.red.circle.other.app.command.user.UserHandleFriendApplyCmdExe;
import com.red.circle.other.app.command.user.UserSendFriendApplyCmdExe;
import com.red.circle.other.app.command.user.query.FriendCheckQryExe;
import com.red.circle.other.app.command.user.query.FriendSearchQryExe;
import com.red.circle.other.app.command.user.query.ImGroupQryExe;
import com.red.circle.other.app.command.user.query.UserFriendApplyListQryExe;
import com.red.circle.other.app.command.user.query.UserFriendListQryExe;
import com.red.circle.other.app.command.user.query.UserIMStatusCheckQryExe;
import com.red.circle.other.app.dto.clientobject.user.relation.friend.UserFriendApplyCO;
import com.red.circle.other.app.dto.clientobject.user.relation.friend.UserFriendCO;
import com.red.circle.other.app.dto.clientobject.user.relation.friend.UserIMStatusCheckCO;
import com.red.circle.other.app.dto.cmd.user.relation.friend.FriendApplyApprovalCmd;
import com.red.circle.other.app.dto.cmd.user.relation.friend.FriendsApplyCmd;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户好友关系 实现.
 *
 * @author pengliang on 2023/8/11
 */
@Service
@RequiredArgsConstructor
public class UserFriendRelationServiceImpl implements UserFriendRelationService {

  private final FriendCheckQryExe friendCheckQryExe;
  private final FriendRemoveCmdExe removeFriendCmdExe;
  private final FriendSearchQryExe friendSearchQryExe;
  private final UserFriendListQryExe userFriendListQryExe;
  private final UserIMStatusCheckQryExe userIMStatusCheckQryExe;
  private final UserFriendApplyListQryExe userFriendApplyListQryExe;
  private final UserSendFriendApplyCmdExe userSendFriendApplyCmdExe;
  private final UserHandleFriendApplyCmdExe userHandleFriendApplyCmdExe;
  private final ImGroupQryExe imGroupQryExe;

  @Override
  public void sendFriendApply(FriendsApplyCmd cmd) {
    userSendFriendApplyCmdExe.execute(cmd);
  }

  @Override
  public void processFriendApply(FriendApplyApprovalCmd cmd) {
    userHandleFriendApplyCmdExe.execute(cmd);
  }

  @Override
  public List<UserFriendApplyCO> listFriendApply(AppFlowCmd cmd) {
    return userFriendApplyListQryExe.execute(cmd);
  }

  @Override
  public List<UserFriendCO> listFriend(AppFlowCmd cmd) {
    return userFriendListQryExe.execute(cmd);
  }

  @Override
  public Boolean checkFriend(AppUserIdCmd cmd) {
    return friendCheckQryExe.execute(cmd);
  }

  @Override
  public UserIMStatusCheckCO checkImChat(AppUserIdCmd cmd) {
    return userIMStatusCheckQryExe.execute(cmd);
  }

  @Override
  public void removeFriend(AppUserIdCmd cmd) {
    removeFriendCmdExe.execute(cmd);
  }

  @Override
  public List<UserFriendCO> friendSearch(AppAccountCmd cmd) {
    return friendSearchQryExe.friendSearch(cmd);
  }

  @Override
  public Boolean createGroup(AppRoomIdCmd roomIdCmd) {

   return imGroupQryExe.execute(roomIdCmd);

  }

  @Override
  public Boolean createGroupTest(AppRoomIdCmd roomIdCmd) {

    return imGroupQryExe.executeTest(roomIdCmd);

  }


}
