package org.springblade.flow.engine.enums;

/**
 * 请求方法的类型
 */
public enum FlowRequestMethodEnum {
    //没有经过
    GET(0, "GET"),
    //经过节点
    POST(1, "POST"),
    //当前节点
    PUT(2, "PUT"),
    //未完成
    Undone(3, "DELETE");

    private Integer code;
    private String message;

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

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    public static  String getMessageByIndex(Integer code){
        for (FlowRequestMethodEnum value : FlowRequestMethodEnum.values()) {
            if(value.getCode().equals(code)){
                return value.getMessage();
            }
        }
        return null;
    }


}
