package com.fdkankan.common.constant;

/**
 * 场景下载进度码
 */
public enum SceneDownloadProgressStatus {
    QUEUEING(0, "排队中"),
    DOWNLOADING(1000, "文件正在下载"),
    DOWNLOAD_COMPRESSING(1001, "文件正在压缩"),
    DOWNLOAD_SUCCESS(1002, "文件压缩成功/下载处理成功"),
    DOWNLOAD_FAILED(1003, "下载处理失败");

    private Integer code;
    private String message;

    private SceneDownloadProgressStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return code;
    }

    public String message() {
        return message;
    }

    public static SceneDownloadProgressStatus get(Integer code){
        SceneDownloadProgressStatus[] values = SceneDownloadProgressStatus.values();
        Integer enumValue = null;
        for(SceneDownloadProgressStatus eachValue : values){
            enumValue = eachValue.code();
            if(enumValue.equals(code)){
                return eachValue;
            }
        }
        return null;
    }

}
