package com.chushang.oss.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum OcrTypeEnum {
	COMM("comm","文字识别"),
	DRIVING("driving","行驶证"),
	BANKCARD("bankcard","银行卡"),
	BIZLICENSE("bizlicense","营业执照"),
	DRIVINGLICENSE("drivinglicense","驾驶证"),
	IDCARD("idcard","身份证"),
	NONE("none","未知")
	;

	private final String code;
	private final String name;

	public static OcrTypeEnum findByCode(String code) {
		for(OcrTypeEnum e:OcrTypeEnum.values()) {
			if(e.getCode().equals(code)) {
				return e;
			}
		}
		return NONE;
	}
}
