Commit ca0b5f60 by 邓实川 Committed by chenzg

application

parent cf673e40
...@@ -16,14 +16,21 @@ import com.alibaba.fastjson.serializer.SerializerFeature; ...@@ -16,14 +16,21 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
import com.alibaba.fastjson.support.config.FastJsonConfig; import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import cn.hutool.core.net.NetUtil;
@MapperScan("cn.timer.api.dao") // 扫描的mapper @MapperScan("cn.timer.api.dao") // 扫描的mapper
//@ComponentScan(basePackages = {"cn.timer.api.controller"}) //@ComponentScan(basePackages = {"cn.timer.api.controller"})
@SpringBootApplication @SpringBootApplication
@EnableScheduling @EnableScheduling
@EnableTransactionManagement @EnableTransactionManagement
public class Application{ public class Application {
public static void main(String[] args) { 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); SpringApplication.run(Application.class, args);
} }
...@@ -47,6 +54,7 @@ public class Application{ ...@@ -47,6 +54,7 @@ public class Application{
// 5.返回HttpMessageConverters对象 // 5.返回HttpMessageConverters对象
return new HttpMessageConverters(converter); return new HttpMessageConverters(converter);
} }
// extends SpringBootServletInitializer // extends SpringBootServletInitializer
@Autowired @Autowired
private RestTemplateBuilder restTemplateBuilder; private RestTemplateBuilder restTemplateBuilder;
...@@ -57,7 +65,8 @@ public class Application{ ...@@ -57,7 +65,8 @@ public class Application{
} }
// @Override // @Override
// protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { // protected SpringApplicationBuilder configure(SpringApplicationBuilder
// builder) {
// return builder.sources(Application.class); // 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