|
@@ -1,17 +1,38 @@
|
|
|
package com.free;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
+import java.util.Properties;
|
|
|
+
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
+import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
|
@MapperScan({ "com.free.mapper", "com.gitee.sunchenbin.mybatis.actable.dao.*" })
|
|
|
@ComponentScan(basePackages = { "com.free", "com.gitee.sunchenbin.mybatis.actable.manager.*" })
|
|
|
-@SpringBootApplication
|
|
|
+@SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
|
|
|
public class Main {
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
SpringApplication.run(Main.class, args);
|
|
|
System.out.println("swagger:");
|
|
|
- System.out.println("http://localhost:4001/swagger-ui/index.html");
|
|
|
+ Properties properties = readProperties("application.yml");
|
|
|
+ String contextPath = properties.getProperty("context-path", "");
|
|
|
+ System.out.println("http://localhost:4001" + contextPath + "/swagger-ui/index.html");
|
|
|
+ }
|
|
|
+
|
|
|
+ private static Properties readProperties(String... confFile) {
|
|
|
+ final Properties properties = new Properties();
|
|
|
+ try {
|
|
|
+ for (String path : confFile) {
|
|
|
+ final ClassPathResource resource = new ClassPathResource(path);
|
|
|
+ properties.load(resource.getInputStream());
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return properties;
|
|
|
}
|
|
|
}
|