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

import com.alibaba.fastjson2.JSONArray;
import lombok.Data;

@Data
public class WSUserMedal {
    private long uid;
    private String medal_name;
    private String medal_color = "FFFFFF";
    private String medal_anchor;
    private int medal_level;

    public static WSUserMedal create(JSONArray array) {
        if (array.isEmpty()) {
            return null;
        }
        WSUserMedal medal = new WSUserMedal();
        medal.setUid(array.getIntValue(3));
        medal.setMedal_name(array.getString(1));
        medal.setMedal_anchor(array.getString(2));
        medal.setMedal_level(array.getIntValue(0));
        return medal;
    }
}
