package com.css.simulation.resource.server.app.constant;

import lombok.Getter;

/**
 * 项目运行状态枚举
 */
@Getter
public enum  ProjectRunStateEnum {

    NOT_START("10","未执行"),
    EXECUTION("20","执行中"),
    FINISH("30","执行完成"),
    DISCONTINUE("40","已中止");


    private String code;

    private String state;

    ProjectRunStateEnum(String code, String state){
        this.code = code;
        this.state = state;
    }

    public static String getState(String code){
        if(code == null){
            return "";
        }
        for(ProjectRunStateEnum e :  ProjectRunStateEnum.values()){
            if(e.code.equals(code)){
                return e.state;
            }
        }
        return "";
    }
}
