package ctop.bytedance.ad.advertise.enums;

public enum BytedanceCreativeMatTypeEnum {
    /**
     * 创意素材类型
     * 0 表示当天
     */
    BYTEDANCE_CREATIVE_MAT_TYPE_ENUM_NEW("1","上新",0L,0L),
    BYTEDANCE_CREATIVE_MAT_TYPE_ENUM_HIGH_QUALITY("2","高质量",-4*60*24L,-1*60*24L),
    BYTEDANCE_CREATIVE_MAT_TYPE_ENUM_MISSING("3","遗漏",-8*60*24L,-1*60*24L),
    BYTEDANCE_CREATIVE_MAT_TYPE_ENUM_HISTORY("4","打捞",-8*60*24L,-1*60*24L),




    BYTEDANCE_CREATIVE_IMAGE_MODE_LARGE("CREATIVE_IMAGE_MODE_LARGE","1","大图横图"),
    BYTEDANCE_CREATIVE_IMAGE_MODE_LARGE_VERTICAL("CREATIVE_IMAGE_MODE_LARGE_VERTICAL","2","大图竖图"),
    BYTEDANCE_CREATIVE_IMAGE_MODE_UNION_SPLASH("CREATIVE_IMAGE_MODE_UNION_SPLASH","3","开屏"),
    BYTEDANCE_CREATIVE_IMAGE_MODE_VIDEO("CREATIVE_IMAGE_MODE_VIDEO","1","横版视频"),
    BYTEDANCE_CREATIVE_IMAGE_MODE_VIDEO_VERTICAL("CREATIVE_IMAGE_MODE_VIDEO_VERTICAL","2","竖版视频");





    /**
     * 类型
     */
    private String type;
    /**
     * 名称
     */
    private String name;
    /**
     * 素材查询的时间区间
     */
    private Long videoGetStartTime;
    private Long videoGetEndTime;

    private String imageMode;

    BytedanceCreativeMatTypeEnum(String type, String name,Long videoGetStartTime,Long videoGetEndTime) {
        this.type = type;
        this.name = name;
        this.videoGetStartTime = videoGetStartTime;
        this.videoGetEndTime = videoGetEndTime;
    }

    public static String getNameByType(String type) {
        for (BytedanceCreativeMatTypeEnum createTypeEnum : BytedanceCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getName();
            }
        }
        return "";
    }

    public static Long getStartTimeByType(String type) {
        for (BytedanceCreativeMatTypeEnum createTypeEnum : BytedanceCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getVideoGetStartTime();
            }
        }
        return -60*8L;
    }

    public static Long getEndTimeByType(String type) {
        for (BytedanceCreativeMatTypeEnum createTypeEnum : BytedanceCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getVideoGetEndTime();
            }
        }
        return -5L;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setName(String value) {
        this.name = value;
    }

    public Long getVideoGetStartTime() {
        return videoGetStartTime;
    }

    public void setVideoGetStartTime(Long videoGetStartTime) {
        this.videoGetStartTime = videoGetStartTime;
    }

    public Long getVideoGetEndTime() {
        return videoGetEndTime;
    }

    public void setVideoGetEndTime(Long videoGetEndTime) {
        this.videoGetEndTime = videoGetEndTime;
    }


    public String getImageMode() {
        return imageMode;
    }

    public void setImageMode(String imageMode) {
        this.imageMode = imageMode;
    }


    BytedanceCreativeMatTypeEnum(String type, String name,String imageMode) {
        this.type = type;
        this.name = name;
        this.imageMode = imageMode;
    }


    public static String getImageModeByType(String type) {
        for (BytedanceCreativeMatTypeEnum createTypeEnum : BytedanceCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getImageMode();
            }
        }
        return "";
    }

}
