Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#785_2 replace imageId to fileName #803

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -623,10 +623,10 @@ class ApiController extends BaseController {
forward controller: "profile", action: "getLocalImage"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure the value of fileName is assigned to parameter imageId since getLocalImage action still uses imageId

}

@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 +661,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"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure the value of fileName is assigned to parameter imageId since retrieveLocalThumbnailImage action still uses imageId

@Parameter(name = "type",
in = ParameterIn.QUERY,
required = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ class ProfileController extends BaseController {
ImageType type = params.type as ImageType
//NB this imageId param already has the file extension on it, really the file name on disk
if (type == ImageType.STAGED) {
displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.imageId, true)
displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.fileName, true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not rename this parameter. keep original. It is used by other parts of application.

} else if (type == ImageType.PRIVATE) {
displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.imageId, true)
displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.fileName, true)
}
} catch (IllegalArgumentException e) {
log.warn(e)
Expand All @@ -428,9 +428,9 @@ class ProfileController extends BaseController {
ImageType type = params.type as ImageType
//NB this imageId param already has the file extension on it, really the file name on disk
if (type == ImageType.STAGED) {
displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.imageId, false)
displayLocalImage("${grailsApplication.config.image.staging.dir}/", params.opusId, params.profileId, params.fileName, false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

} else if (type == ImageType.PRIVATE) {
displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.imageId, false)
displayLocalImage("${grailsApplication.config.image.private.dir}/", params.opusId, params.profileId, params.fileName, false)
}
} catch (IllegalArgumentException e) {
log.warn(e)
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
Loading