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

import cn.iocoder.yudao.module.inspection.vo.CommonDownRespVo;
import lombok.Getter;

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


@Getter
public enum DriverLicenseType {
    A1("A1", "小型汽车"),
    A2("A2", "小型自动挡汽车"),
    A3("A3", "低速载货汽车"),
    B1("B1", "中型客车"),
    B2("B2", "大型货车"),
    C1("C1", "小型汽车"),
    C2("C2", "小型自动挡汽车"),
    C3("C3", "低速载货汽车"),
    C4("C4", "三轮汽车"),
    C5("C5", "残疾人专用小型自动挡载客汽车"),
    D("D", "城市公交车"),
    E("E", "大型客车"),
    F("F", "大型货车"),
    M("M", "轮式自行机械车"),
    N("N", "无轨电车"),
    P("P", "有轨电车");

    private final String id;
    private final String msg;

    DriverLicenseType(String id, String msg) {
        this.id = id;
        this.msg = msg;
    }

    public static List<CommonDownRespVo> getAll() {
        DriverLicenseType[] values = DriverLicenseType.values();
        return Arrays.stream(values).map(item -> {
            CommonDownRespVo commonDownRespVo = new CommonDownRespVo();
            commonDownRespVo.setId(item.getId());
            commonDownRespVo.setMsg(item.getMsg());
            return commonDownRespVo;
        }).collect(Collectors.toList());
    }

    public static List<String> getAllId() {
        DriverLicenseType[] values = DriverLicenseType.values();
        return Arrays.stream(values).map(item -> {
            return item.getId();
        }).collect(Collectors.toList());
    }
}