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

import com.red.circle.common.business.dto.cmd.AppExtCommand;
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.room.UpdateRoomProfileCmdExe;
import com.red.circle.other.app.command.room.query.RoomProfileByIdQryExe;
import com.red.circle.other.app.command.room.query.RoomProfileByUserIdQryExe;
import com.red.circle.other.app.command.room.query.RoomVoiceProfileByUserIdQryExe;
import com.red.circle.other.app.dto.cmd.room.UpdateRoomCmdData;
import com.red.circle.other.inner.model.dto.live.RoomProfileDTO;
import com.red.circle.other.inner.model.dto.live.RoomProfileManagerDTO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 房间资料信息.
 *
 * @author pengliang on 2023/9/21
 */
@Service
@RequiredArgsConstructor
public class RoomProfileServiceImpl implements RoomProfileService {

  private final RoomProfileByIdQryExe roomProfileByIdQryExe;
  private final UpdateRoomProfileCmdExe updateRoomProfileCmdExe;
  private final RoomProfileByUserIdQryExe roomProfileByUserIdQryExe;
  private final RoomVoiceProfileByUserIdQryExe roomVoiceProfileByUserIdQryExe;

  @Override
  public RoomProfileManagerDTO getRoomProfile(AppExtCommand cmd) {
    return roomVoiceProfileByUserIdQryExe.execute(cmd);
  }

  @Override
  public RoomProfileManagerDTO getRoomProfile(AppRoomIdCmd cmd) {
    return roomProfileByIdQryExe.execute(cmd);
  }

  @Override
  public RoomProfileManagerDTO getRoomProfile(AppUserIdCmd cmd) {
    return roomProfileByUserIdQryExe.execute(cmd);
  }

  @Override
  public RoomProfileDTO updateProfile(UpdateRoomCmdData cmd) {
    return updateRoomProfileCmdExe.execute(cmd);
  }

}
