2020-07-03 12:09:22 +02:00
|
|
|
package eu.dnetlib.organizations;
|
|
|
|
|
2022-08-19 13:27:36 +02:00
|
|
|
import org.springdoc.core.GroupedOpenApi;
|
2020-07-03 12:09:22 +02:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
2022-08-19 13:27:36 +02:00
|
|
|
import org.springframework.context.annotation.Bean;
|
2021-11-29 13:37:27 +01:00
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
2021-05-05 15:12:53 +02:00
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
2020-07-03 12:09:22 +02:00
|
|
|
|
2021-01-27 12:17:38 +01:00
|
|
|
import eu.dnetlib.common.app.AbstractDnetApp;
|
2022-08-19 13:27:36 +02:00
|
|
|
import io.swagger.v3.oas.models.OpenAPI;
|
|
|
|
import io.swagger.v3.oas.models.info.Info;
|
|
|
|
import io.swagger.v3.oas.models.info.License;
|
2020-07-03 12:09:22 +02:00
|
|
|
|
2021-11-29 13:37:27 +01:00
|
|
|
@SpringBootApplication
|
2020-07-03 12:09:22 +02:00
|
|
|
@EnableCaching
|
2021-05-05 15:12:53 +02:00
|
|
|
@EnableScheduling
|
2021-11-29 13:37:27 +01:00
|
|
|
@ComponentScan(basePackages = "eu.dnetlib")
|
2021-01-27 12:17:38 +01:00
|
|
|
public class MainApplication extends AbstractDnetApp {
|
2020-07-03 12:09:22 +02:00
|
|
|
|
|
|
|
public static void main(final String[] args) {
|
|
|
|
SpringApplication.run(MainApplication.class, args);
|
|
|
|
}
|
|
|
|
|
2022-08-19 13:27:36 +02:00
|
|
|
@Bean
|
|
|
|
public GroupedOpenApi publicApi() {
|
|
|
|
return GroupedOpenApi.builder()
|
|
|
|
.group("D-Net Organizations Service APIs")
|
|
|
|
.pathsToMatch("/api/**", "/oa_api/**")
|
|
|
|
.build();
|
|
|
|
}
|
|
|
|
|
2021-01-27 12:17:38 +01:00
|
|
|
@Override
|
2022-08-19 13:27:36 +02:00
|
|
|
protected void configSwagger(final OpenAPI openApi) {
|
2022-08-19 15:21:40 +02:00
|
|
|
openApi.info(new Info().title("D-Net Organizations Service APIs")
|
2022-08-19 13:27:36 +02:00
|
|
|
.description("APIs documentation")
|
|
|
|
.version("1.1")
|
2022-08-22 13:36:36 +02:00
|
|
|
.license(new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0")));
|
2020-07-03 12:09:22 +02:00
|
|
|
}
|
2020-07-29 11:31:18 +02:00
|
|
|
|
2020-07-03 12:09:22 +02:00
|
|
|
}
|