package io.geekidea.springbootplus;

import com.wecloud.im.tillo.netty.core.NettyStart;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class StartNettyService implements CommandLineRunner {
    @Value("${netty.port}")
    private int port;

    @Resource
    private NettyStart nettyServer;

    @Override
    public void run(String... args) throws Exception {

        nettyServer.run(port);

    }
}
