dnet-applications/apps/scholexplorer-api/src/main/java/eu/dnetlib/scholix/api/controller/LinkPublisherV2.java

52 lines
2.3 KiB
Java

package eu.dnetlib.scholix.api.controller;
import eu.dnetlib.scholix.api.model.v2.LinkProviderType;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List;
@RestController
@RequestMapping("/v2/LinkPublisher")
@Api(tags = {
"LinkPublisher : Operation related to the Link Publisher"
})
public class LinkPublisherV2 {
@Operation(
summary = "Get All Publishers that provide source object",
description = "Return a List of all Publishers that provide source objects in Scholix " +
"links and the total number of links where the source object comes from this publisher")
@GetMapping("/inSource")
public List<LinkProviderType> getInSource(
@Parameter(in = ParameterIn.QUERY, description = "Filter the link publisher name") @RequestParam(required = false) String name
) {
return Arrays.asList(
new LinkProviderType().name("pippo").totalRelationships(30),
new LinkProviderType().name("pluto").totalRelationships(30),
new LinkProviderType().name("peppa").totalRelationships(30)
);
}
@Operation(
summary = "Get All Publishers that provide target object",
description = "Return a List of all Publishers that provide source objects in Scholix " +
"links and the total number of links where the target object comes from this publisher")
@GetMapping("/inTarget")
public List<LinkProviderType> getInTarget(
@Parameter(in = ParameterIn.QUERY, description = "Filter the link publisher name") @RequestParam(required = false) String name
) {
return Arrays.asList(
new LinkProviderType().name("pippo").totalRelationships(30),
new LinkProviderType().name("pluto").totalRelationships(30),
new LinkProviderType().name("peppa").totalRelationships(30)
);
}
}