method to return a version by id
This commit is contained in:
parent
1fc1a3d69a
commit
ed92f0a3dd
|
@ -111,6 +111,13 @@ public class MDStoreController extends AbstractDnetController {
|
|||
return StatusResponse.ABORTED;
|
||||
}
|
||||
|
||||
@ApiOperation("Return an existing mdstore version")
|
||||
@GetMapping("/version/{versionId}")
|
||||
public MDStoreVersion getVersion(@ApiParam("the id of the version that has to be deleted") @PathVariable final String versionId)
|
||||
throws MDStoreManagerException {
|
||||
return databaseUtils.findVersion(versionId);
|
||||
}
|
||||
|
||||
@ApiOperation("Delete a mdstore version")
|
||||
@DeleteMapping("/version/{versionId}")
|
||||
public StatusResponse deleteVersion(@ApiParam("the id of the version that has to be deleted") @PathVariable final String versionId,
|
||||
|
|
|
@ -68,6 +68,10 @@ public class DatabaseUtils {
|
|||
return mdstoreWithInfoRepository.findById(mdId).orElseThrow(() -> new MDStoreManagerException("Missing mdstore: " + mdId));
|
||||
}
|
||||
|
||||
public MDStoreVersion findVersion(final String versionId) throws MDStoreManagerException {
|
||||
return mdstoreVersionRepository.findById(versionId).orElseThrow(() -> new MDStoreManagerException("Missing mdstore version: " + versionId));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public String createMDStore(final String format,
|
||||
final String layout,
|
||||
|
|
Loading…
Reference in New Issue