Skip to content

Commit

Permalink
Merge pull request #113 from DiSSCo/feature/production-updates
Browse files Browse the repository at this point in the history
Update for the FDO types and the routes
  • Loading branch information
samleeflang authored Dec 9, 2024
2 parents 830f6ee + 64e2fc5 commit e6844f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/pids")
@RequestMapping
@RequiredArgsConstructor
@ControllerAdvice
@Slf4j
public class PidController {

private final PidService service;
private final ApplicationProperties applicationProperties;
private final SchemaValidator validatorComponent;
private static final String RECEIVED_MSG = "Received {} request from user {}";

// Getters
Expand All @@ -51,7 +50,6 @@ public ResponseEntity<JsonApiWrapperRead> resolvePid(@PathVariable("prefix") Str
@PathVariable("suffix") String suffix, HttpServletRequest r) throws PidResolutionException {
String link = applicationProperties.getUiUrl() + "/" + r.getRequestURI();
String handle = prefix + "/" + suffix;

if (prefix.equals(applicationProperties.getPrefix())) {
var node = service.resolveSingleRecord(handle, link);
return ResponseEntity.status(HttpStatus.OK).body(node);
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/eu/dissco/core/handlemanager/domain/fdo/FdoType.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@ public enum FdoType {
DIGITAL_SPECIMEN(
"DigitalSpecimen",
"https://doi.org/21.T11148/894b1e6cad57e921764e",
"https://doi.org/21.T11148/894b1e6cad57e921764e",
"https://doi.org/21.T11148/d8de0819e144e4096645",
DOI_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/bbad8c4e101e8af01115")
@JsonAlias("https://hdl.handle.net/21.T11148/bbad8c4e101e8af01115")
DIGITAL_MEDIA(
"MediaObject",
"https://doi.org/21.T11148/bbad8c4e101e8af01115",
"https://doi.org/21.T11148/bbad8c4e101e8af01115",
"https://doi.org/21.T11148/306452d0867adb910803",
DOI_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/cf458ca9ee1d44a5608f")
@JsonAlias("https://hdl.handle.net/21.T11148/cf458ca9ee1d44a5608f")
ANNOTATION(
"Annotation",
"https://doi.org/21.T11148/cf458ca9ee1d44a5608f",
"https://doi.org/21.T11148/cf458ca9ee1d44a5608f",
"https://doi.org/21.T11148/2e76f544229901c5a942",
HANDLE_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/417a4f472f60f7974c12")
@JsonAlias("https://hdl.handle.net/21.T11148/417a4f472f60f7974c12")
@JsonProperty("https://doi.org/21.T11148/23a63913d0c800609a50")
@JsonAlias("https://hdl.handle.net/21.T11148/23a63913d0c800609a50")
SOURCE_SYSTEM(
"sourceSystem",
"https://doi.org/21.T11148/417a4f472f60f7974c12",
"https://doi.org/21.T11148/23a63913d0c800609a50",
"https://doi.org/21.T11148/417a4f472f60f7974c12",
HANDLE_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/ce794a6f4df42eb7e77e")
@JsonAlias("https://hdl.handle.net/21.T11148/ce794a6f4df42eb7e77e")
DATA_MAPPING(
"Mapping",
"https://doi.org/21.T11148/ce794a6f4df42eb7e77e",
"https://doi.org/21.T11148/ce794a6f4df42eb7e77e",
"https://doi.org/21.T11148/def2eba59562958fa4a0",
HANDLE_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/413c00cbd83ae33d1ac0")
@JsonAlias("https://hdl.handle.net/21.T11148/413c00cbd83ae33d1ac0")
Expand All @@ -76,11 +76,11 @@ public enum FdoType {
"https://doi.org/21.T11148/d7570227982f70256af3",
"https://doi.org/21.T11148/d7570227982f70256af3",
HANDLE_DOMAIN),
@JsonProperty("https://doi.org/21.T11148/22e71a0015cbcfba8ffa")
@JsonAlias("https://hdl.handle.net/21.T11148/22e71a0015cbcfba8ffa")
@JsonProperty("https://doi.org/21.T11148/a369e128df5ef31044d4")
@JsonAlias("https://hdl.handle.net/21.T11148/a369e128df5ef31044d4")
MAS(
"Machine Annotation Service",
"https://doi.org/21.T11148/22e71a0015cbcfba8ffa",
"https://doi.org/21.T11148/a369e128df5ef31044d4",
"https://doi.org/21.T11148/22e71a0015cbcfba8ffa",
HANDLE_DOMAIN);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class PidControllerTest {

@BeforeEach
void setup() {
controller = new PidController(service, applicationProperties, validatorComponent);
controller = new PidController(service, applicationProperties);
}

@Test
Expand Down

0 comments on commit e6844f7

Please sign in to comment.