package com.ruoyi.cai.ws.bean;

import com.ruoyi.cai.ws.constant.RoomStatusEnums;
import lombok.Data;

@Data
public class Room {

    private RoomData roomData;
    private UserData callUserData;
    private UserData receiverUserData;

    public Long getRoomId(){
        return roomData.getRoomId();
    }

    public Integer getStatus(){
        return roomData.getStatus();
    }

    public boolean isCanCall(){
        return RoomStatusEnums.isCanCall(roomData.getStatus());
    }

    public boolean isOnline() {
        return RoomStatusEnums.STATUS_AGREE.getCode().equals(roomData.getStatus());
    }

    /**
     * 房间是否已经结算
     * @return
     */
    public boolean isSettle() {
        return roomData.getSettleTime() != null && roomData.getSettleTime() > 0;
    }


    /**
     * 是否已经释放房间资源
     * @return
     */
    public boolean isReleaseRes(){
        return roomData.isReleaseRes();
    }
}
