|
|
|
@@ -5,6 +5,13 @@ import com.fasterxml.jackson.databind.SerializationFeature; |
|
|
|
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; |
|
|
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
|
|
|
import com.fasterxml.jackson.module.paramnames.ParameterNamesModule; |
|
|
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn; |
|
|
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType; |
|
|
|
import io.swagger.v3.oas.annotations.security.SecurityScheme; |
|
|
|
import io.swagger.v3.oas.models.OpenAPI; |
|
|
|
import io.swagger.v3.oas.models.info.Info; |
|
|
|
import io.swagger.v3.oas.models.info.License; |
|
|
|
import io.swagger.v3.oas.models.servers.Server; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Bean; |
|
|
|
import org.springframework.context.annotation.Primary; |
|
|
|
@@ -26,11 +33,18 @@ import org.springframework.core.env.Environment; |
|
|
|
import javax.annotation.PostConstruct; |
|
|
|
import java.net.InetAddress; |
|
|
|
import java.net.UnknownHostException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@SpringBootApplication |
|
|
|
@EnableConfigurationProperties({LiquibaseProperties.class, ApplicationProperties.class}) |
|
|
|
@SecurityScheme( |
|
|
|
name = "Authorization", |
|
|
|
type = SecuritySchemeType.APIKEY, |
|
|
|
in = SecuritySchemeIn.HEADER |
|
|
|
) |
|
|
|
public class TPFApp { |
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(TPFApp.class); |
|
|
|
@@ -136,4 +150,21 @@ public class TPFApp { |
|
|
|
// dataSourceInitializer.setDatabasePopulator(resourceDatabasePopulator); |
|
|
|
// return dataSourceInitializer; |
|
|
|
// } |
|
|
|
|
|
|
|
@Bean |
|
|
|
public OpenAPI customOpenAPI() { |
|
|
|
List<Server> servers = new ArrayList<>(); |
|
|
|
Server server = new Server(); |
|
|
|
server.setUrl("http://localhost:8080"); |
|
|
|
servers.add(server); |
|
|
|
|
|
|
|
return new OpenAPI() |
|
|
|
.servers(servers) |
|
|
|
.info(new Info() |
|
|
|
.title("SMF API 1.0.0") |
|
|
|
.version("1.0.0") |
|
|
|
.description("@ecos.vn") |
|
|
|
.termsOfService("http://swagger.io/terms/") |
|
|
|
.license(new License().name("Apache 2.0").url("http://springdoc.org"))); |
|
|
|
} |
|
|
|
} |