Skip to content

Commit

Permalink
feat: add delete
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteenke committed Feb 27, 2024
1 parent 3458b5f commit 1f76823
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ public Response uploadImage(Integer contentLength, String refId, RefTypeDTO refT
.build();
}

@Override
public Response deleteImage(String refId, RefTypeDTO refType) {
imageDAO.deleteQueryByRefId(refId);
return Response.status(Response.Status.NO_CONTENT).build();
}

@ServerExceptionMapper
public RestResponse<ProblemDetailResponseDTO> exception(ConstraintException ex) {
return exceptionMapper.exception(ex);
Expand Down
32 changes: 32 additions & 0 deletions src/main/openapi/onecx-image-internal-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,38 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetailResponse'
delete:
tags:
- imagesInternal
description: delete Image by id
operationId: deleteImage
parameters:
- name: refId
in: path
required: true
schema:
type: string
- name: refType
in: path
required: true
schema:
$ref: "#/components/schemas/RefType"
responses:
"200":
description: OK
content:
image/*:
schema:
minimum: 1
maximum: 110000
type: string
format: binary
"400":
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ProblemDetailResponse'
components:
schemas:
RefType:
Expand Down

0 comments on commit 1f76823

Please sign in to comment.