package com.prolog.rdc.tms.constant.enums.intelligent;

import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Map;

/**
 * 智能调度回调类型枚举
 * @author hongbo.pan
 * @date 2023/8/23
 */
@AllArgsConstructor
@Getter
public enum IntelligentDispatchCallBackTypeEnum {

    PROCESS_ID(1, "返回进程id"),
    STAGE(2, "返回处理进度"),
    RESULT(3, "返回处理结果"),
    ;

    private static Map<Integer, IntelligentDispatchCallBackTypeEnum> enumMap = Maps.newHashMap();
    private Integer code;
    private String desc;

    static {
        for(IntelligentDispatchCallBackTypeEnum as : IntelligentDispatchCallBackTypeEnum.values()) {
            enumMap.put(as.code, as);
        }
    }

    public static IntelligentDispatchCallBackTypeEnum getByCode(Integer code) {
        return  enumMap.get(code);
    }

}
