package com.zd.face.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * 初始化SDK
 * @Author: zhoupan
 * @Date: 2021/10/12/10:17
 * @Description:
 */
@Component
@ConditionalOnProperty(prefix = "face",name = "init",havingValue = "true",matchIfMissing = true)
public class SDKRegister implements ApplicationListener<ApplicationStartedEvent> {

    @Autowired
    FaceEngineFactory faceEngineFactory;

    @Override
    public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
        //在线激活
        faceEngineFactory.activeOnline();
    }
}
