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

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

@Getter
@AllArgsConstructor
public enum SourceTypeEnum {
    EXCEL(0, "Excel导入"),
    WEB(1, "Web录入"),
    API(2, "API对接"),
    OCR(3, "OCR识别");

    private final Integer type;
    private final String name;

    public static SourceTypeEnum valueOf(Integer type) {
        return Arrays.stream(values())
                .filter(item -> item.getType().equals(type))
                .findFirst().orElse(null);
    }
}
