package com.fizz.business.constants.enums;


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

@Getter
@AllArgsConstructor
public enum OperModeEnum {

    UNKNOWN(0,"未知"),
    FORCE(1,"轧制力模式"),
    ELONG(2,"延伸率模式");


    private final int code;
    private final String name;

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

}
