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 OperationStepEnum {
    /**
     * 图模获取
     */
    TMHQ("1", "图模获取"),
    /**
     * 图模解析
     */
    TMJX("2", "图模解析"),
    /**
     * 拓扑解析
     */
    TPJX("3", "拓扑解析"),
    /**
     * 故障
     */
    FAULT("4", "故障"),
    /**
     * 调优
     */
    ABNORMAL("5", "调优");

    final String code;
    final String name;


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