-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0823628
commit 74f6d61
Showing
5 changed files
with
160 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
matching-ws/src/main/java/life/catalogue/matching/ExternalID.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package life.catalogue.matching; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Schema(description = "An identifier from another checklist that may be associated with a name usage in the main index", title = "ExternalID", type = "object") | ||
@Data | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@Builder | ||
public class ExternalID { | ||
@Schema(description = "The external identifier that may or may not have been associated with the main index") | ||
private String id; | ||
@Schema(description = "The main index identifier that the external identifier was matched to") | ||
private String mainIndexID; | ||
@Schema(description = "The dataset key of the main index identifier") | ||
private String datasetKey; | ||
@Schema(description = "The parent ID of the external identifier") | ||
private String parentID; | ||
@Schema(description = "The scientific name associated with the external identifier") | ||
private String scientificName; | ||
@Schema(description = "The accepted taxon ID of the external identifier") | ||
private String acceptedTaxonID; | ||
@Schema(description = "The rank of the external identifier") | ||
private String rank; | ||
@Schema(description = "The status of the external identifier") | ||
private String status; | ||
} |
36 changes: 36 additions & 0 deletions
36
matching-ws/src/main/java/life/catalogue/matching/IDController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package life.catalogue.matching; | ||
|
||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class IDController { | ||
|
||
@Autowired | ||
MatchingService matchingService; | ||
|
||
@ApiResponse(responseCode = "200", description = "Name usage suggestions found") | ||
@Tag(name = "ID lookup") | ||
@GetMapping( | ||
value = {"v2/id/{datasetId}/{identifier}"}, | ||
produces = "application/json") | ||
public Object matchV2( | ||
@PathVariable(value = "datasetId", required = false) String datasetId, | ||
@PathVariable(value = "identifier", required = false) String identifier) { | ||
return matchingService.matchID(datasetId, identifier); | ||
} | ||
|
||
@ApiResponse(responseCode = "200", description = "Name usage suggestions found") | ||
@Tag(name = "ID lookup") | ||
@GetMapping( | ||
value = {"v2/id/{identifier}"}, | ||
produces = "application/json") | ||
public Object matchV2( | ||
@PathVariable(value = "identifier", required = false) String identifier) { | ||
return matchingService.matchID(identifier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters