package com.tzld.piaoquan.api.common.enums.contentplatform;

import lombok.Getter;

@Getter
public enum VideoTagEnum {
    /**
     * 票圈受欢迎
     */
    PLATFORM(1, "票圈受欢迎"),
    /**
     * 同类用户喜欢
     */
    TYPE(2, "同类用户喜欢"),
    /**
     * 你的用户爱看
     */
    CHANNEL(3, "你的用户爱看"),
    /**
     * 猜TA想看
     */
    ACCOUNT(4, "猜TA想看"),


    other(999, "其他");

    // 1:票圈受欢迎, 2:同类用户喜欢, 3:你的用户爱看, 4:猜TA想看
    private final int val;
    private final String tag;

    VideoTagEnum(int val, String tag) {
        this.val = val;
        this.tag = tag;
    }

    public static VideoTagEnum from(int val) {
        for (VideoTagEnum tagEnum : VideoTagEnum.values()) {
            if (tagEnum.getVal() == val) {
                return tagEnum;
            }
        }

        return other;
    }
}
