package com.jwipc.supplier.constant;

import lombok.Getter;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Getter
public enum VersionChangeType {
    INIT(-1, "初始"),
    CREATE(1, "新增"),
    EDIT(2, "更新"),
    DEL(3, "删除");

    private final int type;
    private final String desc;

    VersionChangeType(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static VersionChangeType forEach(int type) {
        for (VersionChangeType versionChangeType : VersionChangeType.values()) {
            if (versionChangeType.type == type) {
                return versionChangeType;
            }
        }
        return INIT;
    }
}
