2020-07-03 12:09:22 +02:00
|
|
|
package eu.dnetlib.organizations;
|
|
|
|
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
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;
|
2020-07-03 12:09:22 +02:00
|
|
|
import springfox.documentation.builders.ApiInfoBuilder;
|
|
|
|
import springfox.documentation.builders.RequestHandlerSelectors;
|
|
|
|
import springfox.documentation.service.ApiInfo;
|
|
|
|
import springfox.documentation.spring.web.plugins.Docket;
|
|
|
|
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
|
|
|
|
|
|
@SpringBootApplication
|
|
|
|
@EnableSwagger2
|
|
|
|
@EnableCaching
|
2021-05-05 15:12:53 +02:00
|
|
|
@EnableScheduling
|
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);
|
|
|
|
}
|
|
|
|
|
2021-01-27 12:17:38 +01:00
|
|
|
@Override
|
|
|
|
protected void configSwagger(final Docket docket) {
|
|
|
|
docket.select()
|
2020-07-29 11:31:18 +02:00
|
|
|
.apis(RequestHandlerSelectors.any())
|
2020-10-14 16:28:00 +02:00
|
|
|
.paths(p -> p.startsWith("/api/") || p.startsWith("/oa_api"))
|
2020-07-29 11:31:18 +02:00
|
|
|
.build()
|
|
|
|
.apiInfo(new ApiInfoBuilder()
|
|
|
|
.title("D-Net Organizations Service APIs")
|
|
|
|
.description("APIs documentation")
|
|
|
|
.version("1.1")
|
|
|
|
.contact(ApiInfo.DEFAULT_CONTACT)
|
|
|
|
.license("Apache 2.0")
|
|
|
|
.licenseUrl("http://www.apache.org/licenses/LICENSE-2.0")
|
|
|
|
.build());
|
2020-07-03 12:09:22 +02:00
|
|
|
}
|
2020-07-29 11:31:18 +02:00
|
|
|
|
2020-07-03 12:09:22 +02:00
|
|
|
}
|