package im.zhaojun.system.model;

import java.util.HashMap;
import java.util.Map;

/**
 * @author chenl
 * @version 1.0
 * @date 2020/3/15 10:47
 */
public class CodeConst {
    //�豸ע��
    public static final Integer device_regist = 1;
    //�豸����
    public static final Integer device_update = 2;
    //�豸�¼�
    public static final Integer device_remove = 3;
    //״̬����
    public static final Integer device_report = 4;

    private static Map<Integer, String> eventType = new HashMap<>();

    private static Map<String, Integer> eventTypeQZ = new HashMap<>();

    static {
        eventType.put(1, "�쳣ͣ��");
        eventType.put(2, "����/�ǻ���������");
        eventType.put(3, "����/����");
        eventType.put(4, "ӵ��");
        eventType.put(5, "��ͨ�¼�(�¹ʷ���)");
        eventType.put(6, "��������-��");
        eventType.put(7, "��������-ѩ");
        eventType.put(8, "�̻𱨾�");
        eventType.put(9, "������");
        eventType.put(10, "�ܼ��ȹ���");
        eventType.put(11, "�쳣��ʻ");
        eventType.put(12, "·���ϰ���");
        eventType.put(13, "��·ʩ��");
        eventType.put(14, "ӵ�½���");
        eventType.put(15, "���н���");
        eventType.put(16, "�����¼�");
        eventType.put(17, "��ͨ�¼�(�¹������³�)");
        eventType.put(18, "�����¼�");
    }

    static {
        eventTypeQZ.put("congestion", 4);// 'congestion', '��ͨӵ�¼��'
        eventTypeQZ.put("not_congestion", 14);// 'not_congestion', 'ӵ�½���'
        eventTypeQZ.put("illegal_parking", 1);// 'illegal_parking', '�����쳣ͣʻ���'
        eventTypeQZ.put("wrong_direction", 3);// 'wrong_direction', '����/���м��'
        eventTypeQZ.put("no_motor_ban", 2);// 'no_motor_ban', '����/�ǻ�����������'
        eventTypeQZ.put("slow_deive", 11);// 'slow_deive', '�����쳣���м��'
        eventTypeQZ.put("not_slow_deive", 15);// 'not_slow_deive', '���н���'
        eventTypeQZ.put("single_slow_drive", 11);// 'single_slow_drive', '���ٹ�·���������쳣���м��'
        eventTypeQZ.put("accident", 5);// 'accident', '���ٹ�·��ͨ�¹ʼ��'
        eventTypeQZ.put("roadworks", 13);// 'roadworks', '���ٹ�·��·ʩ�����'
        eventTypeQZ.put("roadworks_out_of_line", 19);// 'roadworks_out_of_line', '���ٹ�·ʩ��Υ����'
        eventTypeQZ.put("severe_weather", 6);// 'severe_weather', '������������ѩ�����'
        eventTypeQZ.put("low_visibility", 10);// 'low_visibility', '��ͨ������'
        eventTypeQZ.put("abandoned_object", 12);// 'abandoned_object', '·���ϰ�����'
        eventTypeQZ.put("tunnel_fire", 8);// 'tunnel_fire', '���ٹ�·���������'
        eventTypeQZ.put("tunnel_smoke", 9);// 'tunnel_smoke', '���ٹ�·���������'
        eventTypeQZ.put("outside_fire", 8);// 'outside_fire', '��ͨ���������'
        eventTypeQZ.put("outside_smoke", 9);// 'outside_smoke', '��ͨ����������'
    }

    public static String getEventType(int type) {
        if (eventType.containsKey(type)) {
            return eventType.get(type);
        }
        return null;
    }

    public static Integer getEventTypeQZ(String type) {
        if (eventTypeQZ.containsKey(type)) {
            Integer code = eventTypeQZ.get(type);
            return code == null ? 18 : code;
        }
        return 18;
    }
}
