
package cn.orionsec.ops.constant.app;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ReleaseType {

    /**
     * 正常发布
     */
    NORMAL(10),

    /**
     * 回滚发布
     */
    ROLLBACK(20),

    ;

    private final Integer type;

    public static ReleaseType of(Integer type) {
        if (type == null) {
            return null;
        }
        for (ReleaseType value : values()) {
            if (value.type.equals(type)) {
                return value;
            }
        }
        return null;
    }

}
