package cn.iocoder.yudao.module.energy.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum AccountStatusEnum {
    NORMAL(0, "正常"),
    WARNING(1, "预警"),
    OVERDUE(2, "欠费");

    private final Integer status;
    private final String name;

    public static AccountStatusEnum valueOf(Integer status) {
        return Arrays.stream(values())
                .filter(item -> item.getStatus().equals(status))
                .findFirst().orElse(null);
    }
}
