package org.jeecg.modules.bytedance.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);

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

    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;
    }
}
