2021-01-25 14:16:37 +01:00
|
|
|
package eu.dnetlib.data.mdstore.manager;
|
|
|
|
|
2021-02-23 15:02:10 +01:00
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
2021-01-25 14:16:37 +01:00
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
2021-05-13 09:01:43 +02:00
|
|
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
2021-01-25 14:16:37 +01:00
|
|
|
import org.springframework.cache.annotation.EnableCaching;
|
2021-11-02 11:50:50 +01:00
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
2021-01-25 14:16:37 +01:00
|
|
|
|
2021-01-27 12:17:38 +01:00
|
|
|
import eu.dnetlib.common.app.AbstractDnetApp;
|
2021-01-25 14:16:37 +01: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-11-02 11:50:50 +01:00
|
|
|
@EnableScheduling
|
2021-05-13 09:01:43 +02:00
|
|
|
@EntityScan("eu.dnetlib.dhp.schema.mdstore")
|
2021-01-27 12:17:38 +01:00
|
|
|
public class MainApplication extends AbstractDnetApp {
|
2021-01-25 14:16:37 +01:00
|
|
|
|
2021-02-23 15:02:10 +01:00
|
|
|
@Value("${dhp.swagger.api.host}")
|
|
|
|
private String swaggetHost;
|
|
|
|
|
|
|
|
@Value("${dhp.swagger.api.basePath}")
|
|
|
|
private String swaggerPath;
|
|
|
|
|
2021-01-25 14:16:37 +01: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) {
|
2021-02-23 15:02:10 +01:00
|
|
|
docket
|
|
|
|
.host(swaggetHost)
|
|
|
|
.pathMapping(swaggerPath)
|
|
|
|
.select()
|
2021-01-27 12:17:38 +01:00
|
|
|
.apis(RequestHandlerSelectors.any())
|
2022-06-01 07:46:32 +02:00
|
|
|
.paths(p -> p.contains("/mdstores"))
|
2021-01-27 12:17:38 +01:00
|
|
|
.build()
|
|
|
|
.apiInfo(new ApiInfoBuilder()
|
|
|
|
.title("MDStore Manager 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());
|
2021-01-25 14:16:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|