package cn.com.poc.expose.websocket.init;

import cn.com.poc.expose.websocket.SuperLinkWebSocketServer;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author alex.yao
 * @date 2023/12/7
 **/
@Component
public class SuperLinkWSRun implements InitializingBean {

    @Resource
    private SuperLinkWebSocketServer superLinkWebSocketServer;

    @Override
    public void afterPropertiesSet() throws Exception {
        if (!superLinkWebSocketServer.isRun()) {
            superLinkWebSocketServer.start();
        }
    }
}
