36 lines
1.1 KiB
Java
36 lines
1.1 KiB
Java
package com;
|
|
|
|
import com.sv.netty.config.SpringContextHolder;
|
|
import com.sv.netty.netty.BootService;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.context.ConfigurableApplicationContext;
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
/**
|
|
* 项目入口
|
|
*/
|
|
@SpringBootApplication
|
|
@EnableScheduling
|
|
@EnableAsync
|
|
@MapperScan(value = {"com.sv.mapper"})
|
|
public class NettyWeiXinApplication {
|
|
|
|
/**
|
|
* 启动项目
|
|
*
|
|
* @param args 启动参数
|
|
*/
|
|
public static void main(String[] args) {
|
|
ConfigurableApplicationContext context = SpringApplication.run(NettyWeiXinApplication.class, args);
|
|
SpringContextHolder.setContext(context);
|
|
//启动netty
|
|
BootService bootService = (BootService) context.getBean("bootService");
|
|
bootService.run();
|
|
}
|
|
|
|
}
|