diff --git a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy index b464416d..d958a192 100644 --- a/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy +++ b/grails-app/controllers/au/org/ala/profile/api/ApiController.groovy @@ -549,10 +549,10 @@ class ApiController extends BaseController { } } - @Path("/api/opus/{opusId}/profile/{profileId}/image/{imageId}") + @Path("/api/opus/{opusId}/profile/{profileId}/image/{fileName}") @Operation( summary = "Get image associated with a profile", - operationId = "/api/opus/{opusId}/profile/{profileId}/image/{imageId}", + operationId = "/api/opus/{opusId}/profile/{profileId}/image/{fileName}", method = "GET", responses = [ @ApiResponse( @@ -587,10 +587,10 @@ class ApiController extends BaseController { in = ParameterIn.PATH, required = true, description = "Profile id - UUID or Scientific name"), - @Parameter(name = "imageId", + @Parameter(name = "fileName", in = ParameterIn.PATH, required = true, - description = "Image id - UUID"), + description = "fileName"), @Parameter(name = "type", in = ParameterIn.QUERY, required = true, @@ -620,13 +620,14 @@ class ApiController extends BaseController { ) def getLocalImage() { + params.imageId = params.fileName forward controller: "profile", action: "getLocalImage" } - @Path("/api/opus/{opusId}/profile/{profileId}/image/thumbnail/{imageId}") + @Path("/api/opus/{opusId}/profile/{profileId}/image/thumbnail/{fileName}") @Operation( summary = "Get thumbnail image associated with a profile", - operationId = "/api/opus/{opusId}/profile/{profileId}/image/thumbnail/{imageId}", + operationId = "/api/opus/{opusId}/profile/{profileId}/image/thumbnail/{fileName}", method = "GET", responses = [ @ApiResponse( @@ -661,10 +662,10 @@ class ApiController extends BaseController { in = ParameterIn.PATH, required = true, description = "Profile id - UUID or Scientific name"), - @Parameter(name = "imageId", + @Parameter(name = "fileName", in = ParameterIn.PATH, required = true, - description = "Image id - UUID"), + description = "fileName"), @Parameter(name = "type", in = ParameterIn.QUERY, required = true, @@ -694,6 +695,7 @@ class ApiController extends BaseController { ) def retrieveLocalThumbnailImage () { + params.imageId = params.fileName forward controller: "profile", action: "retrieveLocalThumbnailImage" } diff --git a/grails-app/controllers/au/org/ala/profile/hub/UrlMappings.groovy b/grails-app/controllers/au/org/ala/profile/hub/UrlMappings.groovy index aa65e764..fab17344 100644 --- a/grails-app/controllers/au/org/ala/profile/hub/UrlMappings.groovy +++ b/grails-app/controllers/au/org/ala/profile/hub/UrlMappings.groovy @@ -264,8 +264,8 @@ class UrlMappings { get "/opus/$opusId/profile" (version: "1.0", controller: "api", action: "getProfiles", namespace: "v1") get "/opus/$opusId/profile/$profileId" (version: "1.0", controller: "api", action: "get", namespace: "v1") get "/opus/$opusId/profile/$profileId/image" (version: "1.0", controller: "api", action: "getImages", namespace: "v1") - get "/opus/$opusId/profile/$profileId/image/$imageId" (version: "1.0", controller: "api", action: "getLocalImage", namespace: "v1") - get "/opus/$opusId/profile/$profileId/image/thumbnail/$imageId" (version: "1.0", controller: "api", action: "retrieveLocalThumbnailImage", namespace: "v1") + get "/opus/$opusId/profile/$profileId/image/$fileName" (version: "1.0", controller: "api", action: "getLocalImage", namespace: "v1") + get "/opus/$opusId/profile/$profileId/image/thumbnail/$fileName" (version: "1.0", controller: "api", action: "retrieveLocalThumbnailImage", namespace: "v1") get "/opus/$opusId/profile/$profileId/attribute/$attributeId" (version: "1.0", controller: "api", action: "getAttributes", namespace: "v1") get "/opus/$opusId/profile/$profileId/draft" (version: "1.0", controller: "api", action: "getDraftProfile", namespace: "v1") get "/opus" (version: "1.0", controller: "api", action: "getListCollections", namespace: "v1")