package com.iwunu.nbiot.lock.util;

import com.iwunu.nbiot.lock.service.IotDictionariesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

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

/**
 * @author kinfeng
 * @date 2021/05/12 10:20 AM
 * @desc 小程序事件类型
 */
@Configuration
public class WebEventTypeKeyUtil {
    public static Map<String,Integer> EVENT_TYPE = new HashMap<>() ;

    // 100: 数据同步成功
    // 102：NB开锁成功，data为空
    // 104：密码开锁成功，data为开锁密码
    // 105：刷卡开锁成功，data为cardId
    // 106：人脸开锁成功，data为faceId
    // 107：指纹开锁成功，data为fingerId
    // 109：无效开锁警报，data为空

    @Autowired
    private IotDictionariesService iotDictionariesService;

    @Bean
    public String initEventType(){
        EVENT_TYPE = iotDictionariesService.listToMapInteger(iotDictionariesService.findListByType("webEvent"));
        return "" ;
    }
}
