package com.fdkankan.ucenter.constant;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public enum CameraTypelEnum {

    FD_KK_1(1,"四维看看", Arrays.asList(1,2,12,13,14),false),
    FD_KK_2(4,"四维看看", Arrays.asList(1,2,12,13,14),false),
    FD_KJ(9,"四维看见", Arrays.asList(3),false),
    FD_SS_LASER(10,"深时", Arrays.asList(4),true),
    FD_SG_LASER(11,"深光", Arrays.asList(5),true),
    FD_SX_LASER(12,"深巡", Arrays.asList(7),true),

    ;

    Integer cameraType;
    String name;
    List<Integer> sceneSource;
    Boolean isLaser;

    CameraTypelEnum(Integer cameraType, String name, List<Integer>sceneSource , Boolean isLaser) {
        this.cameraType = cameraType;
        this.name = name;
        this.sceneSource = sceneSource;
        this.isLaser = isLaser;
    }

    public Integer getCameraType() {
        return cameraType;
    }

    public String getName() {
        return name;
    }

    public List<Integer> getSceneSource() {
        return sceneSource;
    }

    public Boolean getLaser() {
        return isLaser;
    }

    public static List<Map<String, Object>> getAllProperties() {
        return Arrays.stream(values())
                .map(vo -> {
                    Map<String, Object> props = new HashMap<>();
                    props.put("name", vo.name);
                    props.put("cameraType", vo.cameraType);
                    props.put("sceneSource", vo.sceneSource);
                    props.put("isLaser", vo.isLaser);
                    return props;
                })
                .collect(Collectors.toList());
    }

    public static CameraTypelEnum getByCameraType(Integer cameraType) {
        for (CameraTypelEnum value : CameraTypelEnum.values()) {
            if(value.cameraType.equals(cameraType)){
                return value;
            }
        }
        return null;
    }



}
