Guwan-smartSchool/shapelight-admin/src/main/java/net/shapelight/AdminApplication.java

41 lines
1.2 KiB
Java
Raw Normal View History

2020-10-19 17:44:19 +08:00
/**/
package net.shapelight;
import net.shapelight.modules.dev.mqtt.MqttClientUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ImportResource;
import org.springframework.transaction.annotation.EnableTransactionManagement;
//@ImportResource(value = { "classpath:spring/spring.xml" })
@SpringBootApplication//(exclude = DataSourceAutoConfiguration.class)//排除DataSourceConfiguratrion
@EnableCaching
@EnableTransactionManagement
//@MapperScan("net.shapelight.modules.sys.dao")
public class AdminApplication {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
//mqtt服务启动
MqttClientUtil.createClient();
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
//释放工作
//...
} catch (Throwable e) {
e.printStackTrace();
}
}
});
}
}