Skip to content

Commit

Permalink
Merge pull request #803 from AtlasOfLivingAustralia/feature/#785_2
Browse files Browse the repository at this point in the history
#785_2 replace imageId to fileName
  • Loading branch information
temi authored Nov 14, 2023
2 parents a24aae9 + 415134c commit 2cefd40
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions grails-app/controllers/au/org/ala/profile/api/ApiController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -694,6 +695,7 @@ class ApiController extends BaseController {
)

def retrieveLocalThumbnailImage () {
params.imageId = params.fileName
forward controller: "profile", action: "retrieveLocalThumbnailImage"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2cefd40

Please sign in to comment.