package com.ltgk.common.enums;

import lombok.Getter;

/**
 * @Author: w1826
 * @Description: TODO
 * @Date: 2025/1/20 11:04
 * @Version: 1.0
 */
@Getter
public enum AreaType {
    //区域类型 1、重点区域  2、电子围栏
    FOCUS_AREA(1, "重点区域"),
    ELECTRONIC_FENCE(2, "电子围栏");
    private final Integer code;
    private final String name;

    AreaType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static AreaType getAreaType(Integer code) {
        for (AreaType areaType : AreaType.values()) {
            if (areaType.getCode().equals(code)) {
                return areaType;
            }
        }
        return null;
    }
}
