package com.red.circle.other.app.inner.service.live.impl;

import com.red.circle.other.app.inner.convertor.live.RoomTouristInnerConvertor;
import com.red.circle.other.app.inner.service.live.RoomTouristClientService;
import com.red.circle.other.infra.database.mongo.service.live.RoomTouristService;
import com.red.circle.other.inner.model.dto.live.RoomTouristDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 房间足迹.
 *
 * @author pengliang on 2023/11/17
 */
@Service
@RequiredArgsConstructor
public class RoomTouristClientServiceImpl implements RoomTouristClientService {

  private final RoomTouristService roomTouristService;
  private final RoomTouristInnerConvertor roomTouristInnerConvertor;

  @Override
  public List<RoomTouristDTO> listRecentVisitors(Long roomId, Long userId) {
    return roomTouristInnerConvertor.toListRoomTouristDTO(
        roomTouristService.listRecentVisitors(roomId, userId)
    );
  }

}
