package com.fdkankan.common.constant;

public enum ModelingBuildStatus {
    OTHER(-10,"其他原因失败"),
    REPEAT(-3,"重复计算"),
    FAILED(-2,"计算失败"),
    OVERTIME(-1,"计算超时"),
    CALCULATING(0,"计算中"),
    SUCCESS(1,"计算成功");

    private Integer code;
    private String message;

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

    public Integer code() {
        return code;
    }

    public String message() {
        return message;
    }

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

}
