package cn.com.ctop.kuaishou.modules.ai.enums;

/**
 * @author syh
 */
public enum KuaishouProjectCreativeMatTypeEnum {
    /**
     * 13 23 分别是历史遗漏素材，归类到上新素材中
     * type字段 第一位创意创建方式，第二位素材获取方式
     * 快手创意素材获取类型
     */
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_NEW("41","自定义上新",-20L,-10L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_HIGH_quality("42","自定义高质量",-28*60*24L,-1*60*24L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_MISSING("43","自定义上新",-60*60*24L,-1*60*24L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_CUSTOM_HISTORY("44","自定义历史",-60*60*24L,-1*60*24L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_NEW("71","程序化上新",-3*60*24L,-5L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_HIGH_quality("72","程序化高质量",-28*60*24L,-1*60*24L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_MISSING("73","程序化上新",-60*60*24L,-1*60*24L),
    KUAISHOU_CREATIVE_MAT_TYPE_ENUM_PROGRAM_HISTORY("74","程序化历史",-60*60*24L,-1*60*24L),;

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

    KuaishouProjectCreativeMatTypeEnum(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 (KuaishouProjectCreativeMatTypeEnum createTypeEnum : KuaishouProjectCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getName();
            }
        }
        return "";
    }

    public static Long getStartTimeByType(String type) {
        for (KuaishouProjectCreativeMatTypeEnum createTypeEnum : KuaishouProjectCreativeMatTypeEnum.values()) {
            if (createTypeEnum.getType().equals(type)) {
                return createTypeEnum.getVideoGetStartTime();
            }
        }
        return -10L;
    }

    public static Long getEndTimeByType(String type) {
        for (KuaishouProjectCreativeMatTypeEnum createTypeEnum : KuaishouProjectCreativeMatTypeEnum.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;
    }
}
