package com.ywt.mg.domain.models.enums;

/**
 * 对应 download_record 表的 status 字段
 */
public enum DownloadRecordStatusEnum {
    /**
     * 上传状态：0-下载中，1-下载成功，2-下载失败
     */
    Default("获取中", 0),
    SUCCESS("下载成功", 1),
    FAILURE("下载失败", 2);

    private final String displayName;

    private final int value;

    DownloadRecordStatusEnum(String displayName, int value){
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }


    public static String getDisplayName (int value){
        for (DownloadRecordStatusEnum typeEnum: DownloadRecordStatusEnum.values()) {
            if (typeEnum.value == value){
                return typeEnum.displayName;
            }
        }
        return "";
    }
}
