package com.jiayue.ipp.common.data.enums.an;

import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 设备数据对象类型枚举
 * lastModify
 * 2020.3.26  修唯   枚举名修改，新增发电站类型，删除各种功率，设备数，开机容量等类型
 *
 * @author zzy
 * @version 1.0
 * @since 2019/8/19 8:59
 */
@Getter
@AllArgsConstructor
public enum EquipmentTypeEnum implements IEnum<String> {

    /**
     * 场站也视为设备类型的一种
     */
    POWERSTATION(0, "发电站"),
    WEATHERSTATION(1, "气象站"),
    INVERTER(2, "逆变器"),
    WINDTOWER(3, "测风塔"),
    WINDTURBINE(4, "风机");

    private Integer code;
    private String message;


    public static EquipmentTypeEnum valueOf(Integer code) {
        switch (code) {
            case 0:
                return POWERSTATION;
            case 1:
                return WEATHERSTATION;
            case 2:
                return INVERTER;
            case 3:
                return WINDTOWER;
            case 4:
                return WINDTURBINE;
            default:
                return null;
        }
    }

    @Override
    public String getValue() {
        return this.name();
    }
}
