package com.artfess.rescue.external.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: wsf
 * @Description: 事件地点枚举及对应关系
 * @DateTime: 2025/4/23 15:50
 **/
@Getter
@AllArgsConstructor
public enum EventPlaceEnum {

    STAKE("1", "桩号", 5),
    TOLL_STATION("2", "收费站", 1),
    TUNNEL("3", "隧道", 2),
    INTERCHANGE("4", "互通立交", 3),
    SERVICE_AREA("5", "服务区", 4);

    private final String eventPlace;
    private final String eventPlaceValue;
    private final Integer locationType;

    /**
     * 根据 locationType 获取 eventPlace
     *
     * @param type locationType
     * @return eventPlace
     */
    public static String getEventPlaceByLocationType(Integer type) {
        for (EventPlaceEnum e : values()) {
            if (e.getLocationType().equals(type)) {
                return e.getEventPlace();
            }
        }
        return null;
    }
}
