package com.red.circle.live.app.command.mic.qry;

import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
import com.red.circle.live.app.convertor.LiveMicAppConvertor;
import com.red.circle.live.app.dto.clientobject.LiveMicrophoneCO;
import com.red.circle.live.domain.gateway.LiveMicrophoneGateway;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 麦克风列表.
 *
 * @author pengliang on 2023/12/8
 */
@Component
@RequiredArgsConstructor
public class LiveMicListQryExe {

  private final LiveMicAppConvertor liveMicAppConvertor;
  private final LiveMicrophoneGateway liveMicrophoneGateway;

  public List<LiveMicrophoneCO> execute(AppRoomIdCmd cmd) {
    return liveMicAppConvertor.toListLiveMicrophoneCO(
        liveMicrophoneGateway.listLiveMicrophone(cmd.getRoomId()));
  }

}
