package com.fizz.business.constants.enums;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum NextUnitEnum {


    COLD(1,"冷硬卷"),
    HOT(2,"退火卷"),
    OTHER(3,"其他");


    private final int code;
    private final String name;

    // 静态方法，通过 code 获取枚举实例
    public static NextUnitEnum fromCode(int code) {
        for (NextUnitEnum unit : values()) {
            if (unit.getCode() == code) {
                return unit;
            }
        }
        return OTHER;
    }
}
