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

import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.annotation.JSONField;
import lombok.EqualsAndHashCode;

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

@EqualsAndHashCode(callSuper = true)
@lombok.Data
public class WSSendGift extends WSData {
    private Data data;

    public WSSendGift(JSONObject json) {
        super(json);
        data = JSONObject.parseObject(json.getJSONObject("data").toString(), Data.class);
    }

    @Override
    public String toString() {
        return "WSSendGift{" +
                "data=" + data +
                ", cmd='" + cmd + '\'' +
                ", jsonSrc='" + jsonSrc + '\'' +
                ", ws_timer=" + ws_timer +
                '}';
    }

    @lombok.Data
    public static class Data implements Serializable {
        @JSONField(name = "action")
        private String action;
        @JSONField(name = "batch_combo_id")
        private String batchComboID;
        @JSONField(name = "batch_combo_send")
        private ComboSend batchComboSend;
        @JSONField(name = "combo_send")
        private ComboSend comboSend;
        @JSONField(name = "beatId")
        private String beatID;
        @JSONField(name = "biz_source")
        private String bizSource;
        @JSONField(name = "broadcast_id")
        private long broadcastID;
        @JSONField(name = "coin_type")
        private String coinType;
        @JSONField(name = "combo_resources_id")
        private long comboResourcesID;
        @JSONField(name = "combo_stay_time")
        private long comboStayTime;
        @JSONField(name = "combo_total_coin")
        private long comboTotalCoin;
        @JSONField(name = "crit_prob")
        private long critProb;
        @JSONField(name = "demarcation")
        private long demarcation;
        @JSONField(name = "discount_price")
        private long discountPrice;
        @JSONField(name = "dmscore")
        private long dmscore;
        @JSONField(name = "draw")
        private long draw;
        @JSONField(name = "effect")
        private long effect;
        @JSONField(name = "effect_block")
        private long effectBlock;
        @JSONField(name = "face")
        private String face;
        @JSONField(name = "face_effect_id")
        private long faceEffectID;
        @JSONField(name = "face_effect_type")
        private long faceEffectType;
        @JSONField(name = "face_effect_v2")
        private FaceEffectV2 faceEffectV2;
        @JSONField(name = "float_sc_resource_id")
        private long floatScResourceID;
        @JSONField(name = "giftId")
        private int giftId;
        @JSONField(name = "giftName")
        private String giftName;
        @JSONField(name = "giftType")
        private long giftType;
        @JSONField(name = "gift_info")
        private GiftInfo giftInfo;
        @JSONField(name = "gift_tag")
        private List<Long> giftTag;
        @JSONField(name = "gold")
        private long gold;
        @JSONField(name = "guard_level")
        private long guardLevel;
        @JSONField(name = "is_first")
        private boolean isFirst;
        @JSONField(name = "is_join_receiver")
        private boolean isJoinReceiver;
        @JSONField(name = "is_naming")
        private boolean isNaming;
        @JSONField(name = "is_special_batch")
        private long isSpecialBatch;
        @JSONField(name = "magnification")
        private long magnification;
        @JSONField(name = "medal_info")
        private WSMedalInfo medalInfo;
        @JSONField(name = "name_color")
        private String nameColor;
        @JSONField(name = "num")
        private long num;
        @JSONField(name = "original_gift_name")
        private String originalGiftName;
        @JSONField(name = "price")
        private long price;
        @JSONField(name = "rcost")
        private long rcost;
        @JSONField(name = "receive_user_info")
        private ReceiveUserInfo receiveUserInfo;
        @JSONField(name = "receiver_uinfo")
        private ErUinfo receiverUinfo;
        @JSONField(name = "remain")
        private long remain;
        @JSONField(name = "rnd")
        private String rnd;
        @JSONField(name = "sender_uinfo")
        private ErUinfo senderUinfo;
        @JSONField(name = "silver")
        private long silver;
        @JSONField(name = "super")
        private long dataSuper;
        @JSONField(name = "super_batch_gift_num")
        private long superBatchGiftNum;
        @JSONField(name = "super_gift_num")
        private long superGiftNum;
        @JSONField(name = "svga_block")
        private long svgaBlock;
        @JSONField(name = "switch")
        private boolean dataSwitch;
        @JSONField(name = "tag_image")
        private String tagImage;
        @JSONField(name = "tid")
        private String tid;
        @JSONField(name = "timestamp")
        private long timestamp;
        @JSONField(name = "total_coin")
        private long totalCoin;
        @JSONField(name = "uid")
        private long uid;
        @JSONField(name = "uname")
        private String uname;
        @JSONField(name = "wealth_level")
        private long wealthLevel;
    }

    @lombok.Data
    public static class FaceEffectV2 implements Serializable {
        @JSONField(name = "id")
        private long id;
        @JSONField(name = "type")
        private long type;
    }

    @lombok.Data
    public static class GiftInfo implements Serializable {
        @JSONField(name = "effect_id")
        private long effectID;
        @JSONField(name = "has_imaged_gift")
        private long hasImagedGift;
        @JSONField(name = "img_basic")
        private String imgBasic;
        @JSONField(name = "webp")
        private String webp;
    }

    @lombok.Data
    public static class ReceiveUserInfo implements Serializable {
        @JSONField(name = "uid")
        private long uid;
        @JSONField(name = "uname")
        private String uname;
    }

    @lombok.Data
    public static class ErUinfo implements Serializable {
        @JSONField(name = "base")
        private Base base;
        @JSONField(name = "uid")
        private long uid;
    }

    @lombok.Data
    public static class Base implements Serializable {
        @JSONField(name = "face")
        private String face;
        @JSONField(name = "is_mystery")
        private boolean isMystery;
        @JSONField(name = "name")
        private String name;
        @JSONField(name = "name_color")
        private long nameColor;
        @JSONField(name = "name_color_str")
        private String nameColorStr;
        @JSONField(name = "official_info")
        private OfficialInfo officialInfo;
        @JSONField(name = "origin_info")
        private Info originInfo;
        @JSONField(name = "risk_ctrl_info")
        private Info riskCtrlInfo;
    }

    @lombok.Data
    public static class OfficialInfo implements Serializable {
        @JSONField(name = "desc")
        private String desc;
        @JSONField(name = "role")
        private long role;
        @JSONField(name = "title")
        private String title;
        @JSONField(name = "type")
        private long type;
    }

    @lombok.Data
    public static class Info implements Serializable {
        @JSONField(name = "face")
        private String face;
        @JSONField(name = "name")
        private String name;
    }

    @lombok.Data
    public static class ComboSend implements Serializable {
        @JSONField(name = "action")
        private String action;
        @JSONField(name = "combo_id")
        private String comboID;
        @JSONField(name = "combo_num")
        private int comboNum;
        @JSONField(name = "gift_id")
        private long giftID;
        @JSONField(name = "gift_name")
        private String giftName;
        @JSONField(name = "gift_num")
        private int giftNum;
        @JSONField(name = "uid")
        private long uid;
        @JSONField(name = "uname")
        private String uname;
    }
}
