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

import com.red.circle.other.app.command.room.JoinRoomInviteCheckCmd;
import com.red.circle.other.app.command.room.RoomMemberChangeIdentityCmdExe;
import com.red.circle.other.app.command.room.query.RoomSearchMemberQryExe;
import com.red.circle.other.app.dto.clientobject.room.ChangeRoleSuccessCO;
import com.red.circle.other.app.dto.clientobject.room.RoomMemberUserCO;
import com.red.circle.other.app.dto.cmd.room.RoomMemberIdentityCmd;
import com.red.circle.other.app.dto.cmd.room.RoomMemberQryCmd;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 房间成员 实现.
 *
 * @author pengliang on 2023/9/22
 */
@Service
@RequiredArgsConstructor
public class RoomMemberAppServiceImpl implements RoomMemberAppService {

  private final JoinRoomInviteCheckCmd joinRoomInviteCheckCmd;
  private final RoomSearchMemberQryExe roomSearchMemberQryExe;
  private final RoomMemberChangeIdentityCmdExe roomMemberChangeIdentityCmdExe;

  @Override
  public ChangeRoleSuccessCO changeRole(RoomMemberIdentityCmd cmd) {
    return roomMemberChangeIdentityCmdExe.execute(cmd);
  }

  @Override
  public Boolean joinRoomInviteCheck(RoomMemberIdentityCmd cmd) {
    return joinRoomInviteCheckCmd.execute(cmd);
  }

  @Override
  public List<RoomMemberUserCO> listRoomMember(RoomMemberQryCmd cmd) {
    return roomSearchMemberQryExe.execute(cmd);
  }

}
