From e5233fe914208453585610c45965f145e839593a Mon Sep 17 00:00:00 2001 From: Jaehyeon Kim <65964601+Jaehyeon1020@users.noreply.github.com> Date: Sat, 6 Apr 2024 15:02:26 +0000 Subject: [PATCH] docs(be): add delete-image api docs --- apps/iris/go.mod | 4 +- .../admin/Problem/Delete Image/NOT_FOUND.bru | 41 +++++++++++++++++++ .../admin/Problem/Delete Image/Succeed.bru | 31 ++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 collection/admin/Problem/Delete Image/NOT_FOUND.bru create mode 100644 collection/admin/Problem/Delete Image/Succeed.bru diff --git a/apps/iris/go.mod b/apps/iris/go.mod index eb049881ab..6b7c9b547e 100644 --- a/apps/iris/go.mod +++ b/apps/iris/go.mod @@ -4,7 +4,9 @@ go 1.21 require ( github.com/aws/aws-sdk-go-v2 v1.26.1 + github.com/aws/aws-sdk-go-v2/config v1.27.10 github.com/aws/aws-sdk-go-v2/credentials v1.17.10 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 github.com/aws/aws-sdk-go-v2/service/s3 v1.53.0 github.com/rabbitmq/amqp091-go v1.9.0 github.com/redis/go-redis/v9 v9.5.1 @@ -23,8 +25,6 @@ require ( require ( github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.10 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.1 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.5 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.5 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect diff --git a/collection/admin/Problem/Delete Image/NOT_FOUND.bru b/collection/admin/Problem/Delete Image/NOT_FOUND.bru new file mode 100644 index 0000000000..1cf2853622 --- /dev/null +++ b/collection/admin/Problem/Delete Image/NOT_FOUND.bru @@ -0,0 +1,41 @@ +meta { + name: NOT_FOUND + type: graphql + seq: 2 +} + +post { + url: {{gqlUrl}} + body: graphql + auth: none +} + +body:graphql { + mutation DeleteImage ($filename: String!) { + deleteImage(filename: $filename) { + filename + createdById + createTime + } + } +} + +body:graphql:vars { + { + "filename": "not found" + } +} + +assert { + res.body.errors: isDefined + res.body.errors[0].extensions.code: eq NOT_FOUND +} + +docs { + ## Delete Image + S3 Bucket에 업로드된 이미지를 삭제합니다. + + ### Error Cases + #### NOT_FOUND + 존재하는 filename을 사용해야 합니다. +} diff --git a/collection/admin/Problem/Delete Image/Succeed.bru b/collection/admin/Problem/Delete Image/Succeed.bru new file mode 100644 index 0000000000..b0969bfbbb --- /dev/null +++ b/collection/admin/Problem/Delete Image/Succeed.bru @@ -0,0 +1,31 @@ +meta { + name: Succeed + type: graphql + seq: 1 +} + +post { + url: {{gqlUrl}} + body: graphql + auth: none +} + +body:graphql { + mutation DeleteImage ($filename: String!) { + deleteImage(filename: $filename) { + filename + createdById + createTime + } + } +} + +body:graphql:vars { + { + "filename": "fill this field with filename after executing upload-image api" + } +} + +assert { + res.body.data.deleteImage: isDefined +}