package com.ltgk.common.enums;

import lombok.Getter;

/**
 * @Author: w1826
 * @Description: TODO
 * @Date: 2025/1/21 10:34
 * @Version: 1.0
 */
@Getter
public enum FishLimitEarlyType {
    //预警级别  1:渔船预警  2:整体预警  3:整体单一鱼获预警 4:渔船单一鱼获预警
    FISH_LIMIT_EARLY_TYPE_1(1, "渔船预警"),
    FISH_LIMIT_EARLY_TYPE_2(2, "整体预警"),
    FISH_LIMIT_EARLY_TYPE_3(3, "整体单一鱼获预警"),
    FISH_LIMIT_EARLY_TYPE_4(4, "渔船单一鱼获预警");
    private final Integer code;
    private final String info;

    FishLimitEarlyType(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public static String getInfoByCode(Integer code) {
        for (FishLimitEarlyType fishLimitEarlyType : FishLimitEarlyType.values()) {
            if (fishLimitEarlyType.getCode().equals(code)) {
                return fishLimitEarlyType.getInfo();
            }
        }
        return null;
    }

}
