Commit ca0b5f60 by 邓实川 Committed by chenzg

application

parent cf673e40
......@@ -16,14 +16,21 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import cn.hutool.core.net.NetUtil;
@MapperScan("cn.timer.api.dao") // 扫描的mapper
//@ComponentScan(basePackages = {"cn.timer.api.controller"})
@SpringBootApplication
@EnableScheduling
@EnableTransactionManagement
public class Application{
public class Application {
public static void main(String[] args) {
final Integer port = 8089;
if (!NetUtil.isUsableLocalPort(port)) {
System.err.printf("端口%d被占用了,无法启动%n", port);
System.exit(1);
}
SpringApplication.run(Application.class, args);
}
......@@ -47,6 +54,7 @@ public class Application{
// 5.返回HttpMessageConverters对象
return new HttpMessageConverters(converter);
}
// extends SpringBootServletInitializer
@Autowired
private RestTemplateBuilder restTemplateBuilder;
......@@ -57,7 +65,8 @@ public class Application{
}
// @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
// protected SpringApplicationBuilder configure(SpringApplicationBuilder
// builder) {
// return builder.sources(Application.class);
// }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment