package com.yutou.biliapi.bean.live.database;

import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.annotation.JSONField;
import com.yutou.biliapi.bean.live.LiveRoomInfo;
import com.yutou.common.databases.AbsDatabasesBean;
import com.yutou.common.utils.Log;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.lang.reflect.Field;
import java.math.BigInteger;
import java.util.List;

@EqualsAndHashCode(callSuper = true)
@Data
public class LiveInfoDatabaseBean extends AbsDatabasesBean {
    @JSONField(name = "id")
    int id;
    @JSONField(name = "roomId")
    private String roomId;
    @JSONField(name = "anchorUid")
    private String anchorUid;
    @JSONField(name = "title")
    private String title;
    @JSONField(name = "record_time_start")
    private long recordTimeStart;
    @JSONField(name = "record_time_end")
    private long recordTimeEnd;
    @JSONField(name = "cover")
    private String cover;
    @JSONField(name = "room_info")
    private String roomInfo;

    public LiveInfoDatabaseBean(LiveRoomInfo info) {
        super("info", System.currentTimeMillis());
        roomId = info.getRoomId();
        roomInfo = JSONObject.toJSONString(info);
        recordTimeStart = System.currentTimeMillis();
        anchorUid = info.getUid();
        title = info.getTitle();
        cover = info.getUserCover();
    }


    public LiveInfoDatabaseBean() {
        super("info", System.currentTimeMillis());
    }

    public static void main(String[] args) {
        List<Field> list = new LiveInfoDatabaseBean().getFields();
        for (Field field : list) {
            Log.i(field.getName());
        }


    }
}
