- Upgrade Spring and other dependencies.
- Migrate to SpringDoc, since SpringFox is dead.
This commit is contained in:
parent
ab854a6624
commit
8f6426eaf6
|
@ -1,4 +1,4 @@
|
|||
# Provide
|
||||
# uoa-repository-manager-service (Provide backend)
|
||||
|
||||
[...]
|
||||
|
||||
|
|
58
pom.xml
58
pom.xml
|
@ -6,7 +6,7 @@
|
|||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.7.12</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
@ -16,13 +16,14 @@
|
|||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<spring.boot.version>2.5.4</spring.boot.version>
|
||||
<spring.boot.version>2.7.12</spring.boot.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -33,35 +34,44 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jdbc</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.1.214</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -144,13 +154,13 @@
|
|||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib-nodep</artifactId>
|
||||
<version>2.2</version>
|
||||
<version>2.2.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.4</version>
|
||||
<version>2.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -158,10 +168,12 @@
|
|||
<artifactId>oai4j</artifactId>
|
||||
<version>[0.6b1,)</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TODO - Do we need this? -->
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.7.2</version>
|
||||
<version>2.7.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -170,11 +182,14 @@
|
|||
<version>1.19.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- TODO - Do we need this? We already have: "com.google.code.gson:gson" -->
|
||||
<dependency>
|
||||
<groupId>org.aksw.gson</groupId>
|
||||
<artifactId>gson-utils-core</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
|
@ -188,14 +203,26 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.7.0</version>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-webmvc-core</artifactId>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.7.0</version>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-security</artifactId>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.webjars/webjars-locator-core -->
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>webjars-locator-core</artifactId>
|
||||
<version>0.52</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/postgresql/postgresql -->
|
||||
|
@ -208,13 +235,13 @@
|
|||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.4</version>
|
||||
<version>1.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mitre</groupId>
|
||||
<artifactId>openid-connect-client</artifactId>
|
||||
<version>1.3.0</version>
|
||||
<version>1.3.4</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
@ -225,13 +252,14 @@
|
|||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
<version>2.7.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/redis.clients/jedis -->
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>${jedis.version}</version>
|
||||
<version>${jedis.version}</version> <!-- This property comes from the parent-pom. -->
|
||||
<!--<version>3.7.0</version>-->
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -281,7 +309,7 @@
|
|||
<dependency>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>activation</artifactId>
|
||||
<version>1.1-rev-1</version>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
|
|
@ -64,6 +64,7 @@ public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||
.authorizeRequests()
|
||||
.regexMatchers("/actuator/.*").permitAll()
|
||||
.regexMatchers("/metrics").permitAll()
|
||||
.antMatchers("/v3/api-docs/**","/swagger-ui/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
.and()
|
||||
.logout().logoutUrl("/openid_logout")
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package eu.dnetlib.repo.manager.config;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||
import io.swagger.v3.oas.annotations.info.Contact;
|
||||
import io.swagger.v3.oas.annotations.info.Info;
|
||||
import io.swagger.v3.oas.annotations.info.License;
|
||||
|
||||
@OpenAPIDefinition(
|
||||
info = @Info(
|
||||
title = "Repository Manager Dashboard API Documentation",
|
||||
description = "Repository Manager Dashboard API Documentation",
|
||||
version = "1.0",
|
||||
termsOfService = "urn:tos",
|
||||
license = @License(
|
||||
name = "Apache 2.0",
|
||||
url = "https://www.apache.org/licenses/LICENSE-2.0.html"
|
||||
),
|
||||
contact = @Contact(name = "", url = "", email = "")
|
||||
)
|
||||
)
|
||||
public class OpenAPIConfiguration {
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package eu.dnetlib.repo.manager.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.service.VendorExtension;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* Created by panagiotis on 16/11/2017.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableWebMvc
|
||||
public class SwaggerConfig {
|
||||
|
||||
@Bean
|
||||
public Docket productApi() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
.pathMapping("/")
|
||||
.apiInfo(getApiInfo());
|
||||
}
|
||||
|
||||
private ApiInfo getApiInfo() {
|
||||
return new ApiInfo("Repository Manager Dashboard API Documentation",
|
||||
"Repository Manager Dashboard API Documentation",
|
||||
"1.0",
|
||||
"urn:tos",
|
||||
new Contact("", "", ""),
|
||||
"Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0",
|
||||
new ArrayList<VendorExtension>());
|
||||
}
|
||||
|
||||
}
|
|
@ -4,8 +4,8 @@ import eu.dnetlib.repo.manager.domain.Term;
|
|||
import eu.dnetlib.repo.manager.domain.broker.*;
|
||||
import eu.dnetlib.repo.manager.exception.BrokerException;
|
||||
import eu.dnetlib.repo.manager.service.BrokerServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -21,7 +21,7 @@ import java.util.Map;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/broker")
|
||||
@Api(description = "Broker API", tags = {"broker"})
|
||||
@Tag(name="broker", description="Broker API")
|
||||
public class BrokerController{
|
||||
|
||||
@Autowired
|
||||
|
@ -33,9 +33,9 @@ public class BrokerController{
|
|||
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
||||
public DatasourcesBroker getDatasourcesOfUser(
|
||||
@RequestParam("includeShared")
|
||||
@ApiParam(value = "Include shared datasources", required = true , defaultValue = "false") String includeShared,
|
||||
@Parameter(description = "Include shared datasources (default = false)", required = true) String includeShared,
|
||||
@RequestParam("includeByOthers")
|
||||
@ApiParam(value = "Include datasources of other", required = true,defaultValue = "false") String includeByOthers) throws JSONException {
|
||||
@Parameter(description = "Include datasources of other (default = false)", required = true) String includeByOthers) throws JSONException {
|
||||
return brokerService.getDatasourcesOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), includeShared, includeByOthers);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import eu.dnetlib.repo.manager.domain.UsageSummary;
|
|||
import eu.dnetlib.repo.manager.exception.BrokerException;
|
||||
import eu.dnetlib.repo.manager.exception.RepositoryServiceException;
|
||||
import eu.dnetlib.repo.manager.service.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/dashboard")
|
||||
@Api(description = "Dashboard API", tags = {"dashboard"})
|
||||
@Tag(name="dashboard", description = "Dashboard API")
|
||||
public class DashboardController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -4,8 +4,8 @@ import eu.dnetlib.api.functionality.ValidatorServiceException;
|
|||
import eu.dnetlib.domain.functionality.validator.StoredJob;
|
||||
import eu.dnetlib.repo.manager.domain.JobsOfUser;
|
||||
import eu.dnetlib.repo.manager.service.MonitorServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/monitor")
|
||||
@Api(description = "Monitor API", tags = {"monitor"})
|
||||
@Tag(name="monitor", description="Monitor API")
|
||||
public class MonitorController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MonitorController.class);
|
||||
|
@ -31,13 +31,13 @@ public class MonitorController {
|
|||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
||||
public JobsOfUser getJobsOfUser(@RequestParam(value = "jobType", required = false)
|
||||
@ApiParam(value = "Equals to filter job type on validation history page") String jobType,
|
||||
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset,
|
||||
@RequestParam(value = "limit", required = false,defaultValue = "10") @ApiParam(value = "Null value") String limit,
|
||||
@RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom,
|
||||
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo,
|
||||
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = false) String validationStatus,
|
||||
@RequestParam("includeJobsTotal") @ApiParam(value = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException {
|
||||
@Parameter(description = "Equals to filter job type on validation history page") String jobType,
|
||||
@RequestParam("offset") @Parameter(name = "Page number", required = true) String offset,
|
||||
@RequestParam(value = "limit", required = false,defaultValue = "10") @Parameter(description = "Null value") String limit,
|
||||
@RequestParam(value = "dateFrom", required = false) @Parameter(description = "Null value") String dateFrom,
|
||||
@RequestParam(value = "dateTo", required = false) @Parameter(description = "Null value") String dateTo,
|
||||
@RequestParam("validationStatus") @Parameter(description = "Equals to filter validation jobs", required = false) String validationStatus,
|
||||
@RequestParam("includeJobsTotal") @Parameter(description = "Always true", required = true) String includeJobsTotal) throws JSONException, ValidatorServiceException {
|
||||
return monitorService.getJobsOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), jobType, offset, limit, dateFrom, dateTo, validationStatus, includeJobsTotal);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import eu.dnetlib.repo.manager.domain.OrderByType;
|
|||
import eu.dnetlib.repo.manager.domain.Paging;
|
||||
import eu.dnetlib.repo.manager.exception.RepositoryServiceException;
|
||||
import eu.dnetlib.repo.manager.service.PiWikServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Parameters;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/piwik")
|
||||
@Api(description = "Piwik API", tags = {"piwik"})
|
||||
@Tag(name="piwik", description = "Piwik API")
|
||||
public class PiWikController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PiWikController.class);
|
||||
|
@ -53,12 +53,12 @@ public class PiWikController {
|
|||
}
|
||||
|
||||
@RequestMapping(value = "/getPiwikSitesForRepos" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "from", dataType = "number", paramType = "query"),
|
||||
@ApiImplicitParam(name = "quantity", dataType = "number", paramType = "query"),
|
||||
@ApiImplicitParam(name = "order", dataType = "eu.dnetlib.repo.manager.domain.OrderByType", paramType = "query"),
|
||||
@ApiImplicitParam(name = "orderField", dataType = "eu.dnetlib.repo.manager.domain.OrderByField", paramType = "query"),
|
||||
@ApiImplicitParam(name = "searchField", dataType = "string", paramType = "query"),
|
||||
@Parameters({
|
||||
@Parameter(name = "from", description = "number"),
|
||||
@Parameter(name = "quantity", description = "number"),
|
||||
@Parameter(name = "order", description = "eu.dnetlib.repo.manager.domain.OrderByType"),
|
||||
@Parameter(name = "orderField", description = "eu.dnetlib.repo.manager.domain.OrderByField"),
|
||||
@Parameter(name = "searchField", description = "string")
|
||||
})
|
||||
public Paging<PiwikInfo> getPiwikSitesForRepos(
|
||||
@RequestParam(value = "from",required=false,defaultValue = "0") int from,
|
||||
|
@ -77,12 +77,12 @@ public class PiWikController {
|
|||
return results;
|
||||
}
|
||||
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "from", dataType = "number", paramType = "query"),
|
||||
@ApiImplicitParam(name = "quantity", dataType = "number", paramType = "query"),
|
||||
@ApiImplicitParam(name = "order", dataType = "eu.dnetlib.repo.manager.domain.OrderByType", paramType = "query"),
|
||||
@ApiImplicitParam(name = "searchField", dataType = "eu.dnetlib.repo.manager.domain.OrderByField", paramType = "query"),
|
||||
@ApiImplicitParam(name = "orderField", dataType = "string", paramType = "query"),
|
||||
@Parameters({
|
||||
@Parameter(name = "from", description = "number"),
|
||||
@Parameter(name = "quantity", description = "number"),
|
||||
@Parameter(name = "order", description = "eu.dnetlib.repo.manager.domain.OrderByType"),
|
||||
@Parameter(name = "searchField", description = "eu.dnetlib.repo.manager.domain.OrderByField"),
|
||||
@Parameter(name = "orderField", description = "string")
|
||||
})
|
||||
@RequestMapping(value = "/getPiwikSitesForRepos/csv" , method = RequestMethod.GET,produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
||||
@ResponseBody
|
||||
|
|
|
@ -10,7 +10,7 @@ import eu.dnetlib.repo.manager.service.AggregationService;
|
|||
import eu.dnetlib.repo.manager.service.RepositoryService;
|
||||
import eu.dnetlib.repo.manager.service.security.AuthorizationService;
|
||||
import eu.dnetlib.repo.manager.utils.JsonUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -32,7 +32,7 @@ import java.util.Map;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/repositories")
|
||||
@Api(description = "Repository API", tags = {"repositories"})
|
||||
@Tag(name="repositories", description="Repository API")
|
||||
public class RepositoryController {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(RepositoryController.class);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package eu.dnetlib.repo.manager.controllers;
|
||||
|
||||
import eu.dnetlib.repo.manager.service.StatsServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -13,7 +13,7 @@ import java.util.Map;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/stats")
|
||||
@Api(description = "Stats API", tags = {"statistics"})
|
||||
@Tag(name="statistics", description = "Stats API")
|
||||
public class StatsController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -2,7 +2,7 @@ package eu.dnetlib.repo.manager.controllers;
|
|||
|
||||
import eu.dnetlib.repo.manager.service.sushilite.SushiliteServiceImpl;
|
||||
import eu.dnetlib.usagestats.sushilite.domain.ReportResponseWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/sushilite")
|
||||
@Api(description = "Sushi-Lite API", tags = {"sushilite"})
|
||||
@Tag(name="sushilite", description = "Sushi-Lite API")
|
||||
public class SushiliteController {
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package eu.dnetlib.repo.manager.controllers;
|
|||
|
||||
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5Service;
|
||||
import eu.dnetlib.repo.manager.service.sushilite.SushiliteR5ServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/sushiliteR5")
|
||||
@Api(description = "Sushi-Lite R5 API", tags = {"sushiliteR5"})
|
||||
@Tag(name="sushiliteR5", description = "Sushi-Lite R5 API")
|
||||
public class SushiliteR5Controller {
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package eu.dnetlib.repo.manager.controllers;
|
||||
|
||||
import eu.dnetlib.repo.manager.service.UserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/user")
|
||||
@Api(description = "User API", tags = {"user"})
|
||||
@Tag(name="user", description = "User API")
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -9,8 +9,8 @@ import eu.dnetlib.repo.manager.exception.ResourceNotFoundException;
|
|||
import eu.dnetlib.repo.manager.exception.ValidationServiceException;
|
||||
import eu.dnetlib.repo.manager.service.EmailUtils;
|
||||
import eu.dnetlib.repo.manager.service.ValidatorServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.json.JSONException;
|
||||
import org.mitre.openid.connect.model.OIDCAuthenticationToken;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||
|
||||
@RestController
|
||||
@RequestMapping(value = "/validator")
|
||||
@Api(description = "Validator API", tags = {"validator"})
|
||||
@Tag(name="validator", description = "Validator API")
|
||||
public class ValidatorController {
|
||||
|
||||
@Autowired
|
||||
|
@ -80,12 +80,12 @@ public class ValidatorController {
|
|||
@ResponseBody
|
||||
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
||||
public List<StoredJob> getStoredJobsNew(@RequestParam(value = "jobType", required = false)
|
||||
@ApiParam(value = "Equals to filter job type on validation history page") String jobType,
|
||||
@RequestParam("offset") @ApiParam(value = "Page number", required = true) String offset,
|
||||
@RequestParam(value = "limit", required = false,defaultValue = "10") @ApiParam(value = "Null value") String limit,
|
||||
@RequestParam(value = "dateFrom", required = false) @ApiParam(value = "Null value") String dateFrom,
|
||||
@RequestParam(value = "dateTo", required = false) @ApiParam(value = "Null value") String dateTo,
|
||||
@RequestParam("validationStatus") @ApiParam(value = "Equals to filter validation jobs", required = true) String validationStatus
|
||||
@Parameter(description = "Equals to filter job type on validation history page") String jobType,
|
||||
@RequestParam("offset") @Parameter(description = "Page number", required = true) String offset,
|
||||
@RequestParam(value = "limit", required = false,defaultValue = "10") @Parameter(description = "Null value") String limit,
|
||||
@RequestParam(value = "dateFrom", required = false) @Parameter(description = "Null value") String dateFrom,
|
||||
@RequestParam(value = "dateTo", required = false) @Parameter(description = "Null value") String dateTo,
|
||||
@RequestParam("validationStatus") @Parameter(description = "Equals to filter validation jobs", required = true) String validationStatus
|
||||
) throws ValidatorServiceException {
|
||||
return validatorService.getStoredJobsNew(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), jobType, offset, limit, dateFrom, dateTo, validationStatus);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
springdoc.swagger-ui:
|
||||
disable-swagger-default-url: true
|
||||
version: 3
|
||||
server:
|
||||
port: 8480
|
||||
servlet:
|
||||
context-path: /uoa-repository-manager-service
|
||||
|
||||
springdoc:
|
||||
swagger-ui:
|
||||
disable-swagger-default-url: true
|
||||
path: /swagger-ui.html
|
||||
api-docs:
|
||||
path: /api-docs
|
||||
|
||||
spring:
|
||||
jpa:
|
||||
|
|
Loading…
Reference in New Issue