package cn.orionsec.ops.constant.history;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum HistoryOperator {

    /**
     * 添加
     */
    ADD(1),

    /**
     * 更新
     */
    UPDATE(2),

    /**
     * 删除
     */
    DELETE(3),

    ;

    private final Integer type;

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

}
