package com.xcong.excoin.quartz.job; import com.xcong.excoin.netty.server.TcpServer; import com.xcong.excoin.netty.server.WebSocketServer; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContextAware; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; /** * @author wzy * @date 2021-02-26 **/ @Slf4j @Component public class NettyServerStartUp { @Autowired WebSocketServer webSocketServer; @Autowired TcpServer tcpServer; @Order(0) @PostConstruct public void start() throws Exception { log.info("启动netty服务器"); webSocketServer.start(); tcpServer.start(); } }