package com.hdkj.lt.base.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 日志事件类型
 * @Author: liuAini
 * @Create: 2025/07/18 10:55
 * @Version: 1.0
 */
@Getter
@AllArgsConstructor
public enum EventTypeEnum {
    /**
     * 图模
     */
    TOPO_DATA("1", "图模"),
    /**
     * 成图
     */
    TOPO_FILE("2", "成图"),
    /**
     * 计划
     */
    PLAN("3", "计划"),
    /**
     * 故障
     */
    FAULT("4", "故障"),
    /**
     * 调优
     */
    ABNORMAL("5", "调优");

    final String code;
    final String name;


    public static String getEventTypeCode(String name) {
        for (EventTypeEnum typeEnum : EventTypeEnum.values()) {
            if (typeEnum.getName().equals(name)) {
                return typeEnum.getCode();
            }
        }
        return null;
    }
    public static String getEventTypeName(String code) {
        for (EventTypeEnum typeEnum : EventTypeEnum.values()) {
            if (typeEnum.getCode().equals(code)) {
                return typeEnum.getName();
            }
        }
        return null;
    }
}
