package com.red.circle.other.app.service.room;

import com.red.circle.common.business.dto.cmd.app.AppFlowCmd;
import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
import com.red.circle.other.app.command.room.RoomSubscriptionCmdExe;
import com.red.circle.other.app.command.room.UploadRoomTouristCmdExe;
import com.red.circle.other.app.command.room.query.*;
import com.red.circle.other.app.dto.clientobject.room.RoomBrowseRecordsV2CO;
import com.red.circle.other.app.dto.clientobject.room.RoomCheckStatusCO;
import com.red.circle.other.app.dto.cmd.room.RoomSubscriptionCmd;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 房间关系 实现.
 *
 * @author pengliang on 2023/9/21
 */
@Service
@RequiredArgsConstructor
public class RoomRelationServiceImpl implements RoomRelationService {

  private final RoomGiftListQueryExe roomGiftListQueryExe;
  private final UserTraceRoomsQryExe userTraceRoomsQryExe;
  private final UserFollowRoomsQryExe userFollowRoomsQryExe;
  private final UserJoinedRoomsQryExe userJoinedRoomsQryExe;
  private final RoomSubscriptionCmdExe roomSubscriptionCmdExe;
  private final UploadRoomTouristCmdExe uploadRoomTouristCmdExe;
  private final RoomRelationStatusCheckQryExe roomRelationStatusCheckQryExe;

  @Override
  public List<RoomBrowseRecordsV2CO> listUserTrace(AppFlowCmd cmd) {
    return userTraceRoomsQryExe.execute(cmd);
  }

  @Override
  public List<RoomBrowseRecordsV2CO> listUserJoined(AppFlowCmd cmd) {
    return userJoinedRoomsQryExe.execute(cmd);
  }

  @Override
  public List<RoomBrowseRecordsV2CO> listUserFollow(AppFlowCmd cmd) {
    return userFollowRoomsQryExe.execute(cmd);
  }

  @Override
  public List<RoomBrowseRecordsV2CO> listUserRecommend(AppFlowCmd cmd) {
    return roomGiftListQueryExe.execute(cmd);
  }
  @Override
  public void uploadTrace(AppRoomIdCmd cmd) {
    uploadRoomTouristCmdExe.execute(cmd);
  }

  @Override
  public Boolean followOrCancelRoom(RoomSubscriptionCmd cmd) {
   return roomSubscriptionCmdExe.execute(cmd);
  }

  @Override
  public RoomCheckStatusCO checkStatus(AppRoomIdCmd cmd) {
    return roomRelationStatusCheckQryExe.execute(cmd);
  }

}
