package com.fastbee.ggroup.enums;

import lombok.Getter;

@Getter
public enum GroupTagEnum {
    RIVERS_LAKES(1, "江河湖泊"),
    WATER_CONSERVANCY_PROJECTS(2, "水利工程"),
    MONITORING_STATIONS(3, "检测站点"),
    OTHER_OBJECTS(4, "其他对象"),
    WATER_AFFAIRS(5, "水利事务"),
    ADMINISTRATIVE_REGION(7, "行政区域"),
    ALARM_EVENTS(6, "报警事件");

    private final int code;
    private final String description;

    GroupTagEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public static GroupTagEnum fromCode(int code) {
        for (GroupTagEnum tag : GroupTagEnum.values()) {
            if (tag.getCode() == code) {
                return tag;
            }
        }
        throw new IllegalArgumentException("No tag found with code: " + code);
    }
}
