package com.yutou.bilibili.mybatis.Bili.mybatis.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.yutou.bilibili.BiliBili.LiveUtils;
import lombok.Data;

/**
 * bilibili_up_info
 * @author 
 */
@Data
public class BilibiliUpInfo implements Serializable {
    private Integer id;

    /**
     * UP名字
     */
    private String name;

    /**
     * 直播间
     */
    private String url;

    private Long mid=0L;

    /**
     * 房间号
     */
    private Integer roomid;

    /**
     * 是否24小时监视
     */
    private Integer offlinelistening=0;

    private Integer savedanmu=0;

    private Integer enable=0;

    private Integer live=0;

    private Integer savelive=0;

    private static final long serialVersionUID = 1L;

    public Integer checkLiveStatus(){
        List<BilibiliUpInfo> list=new ArrayList<>();
        list.add(this);
        live= LiveUtils.getStatusInfoByUid(list).getJSONObject("data").getJSONObject(mid+"").getInteger("live_status");
        return live;
    }

    public Integer getLive() {
        return live;
    }
}