From a81d51fd30d021215c9291071351f1de49e4c54a Mon Sep 17 00:00:00 2001 From: jinno Yun Date: Mon, 30 Sep 2024 16:07:45 +0900 Subject: [PATCH] =?UTF-8?q?#25=20feat:=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=A1=9C=20=EB=A9=94=ED=83=80=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=96=BB=EB=8A=94=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EB=82=B4?= =?UTF-8?q?=EC=97=90=20=EB=94=94=EC=BD=94=EB=94=A9=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../compileJava/previous-compilation-data.bin | Bin 2183005 -> 2183005 bytes .../controller/S3StorageController.java | 2 +- .../s3Storage/service/S3StorageService.java | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web3-credential-server/build/tmp/compileJava/previous-compilation-data.bin b/web3-credential-server/build/tmp/compileJava/previous-compilation-data.bin index daa02bd6f8393fc674d37d671a291e1d29bf3fd5..addcac5ffe208f33b6d1c138a2421201681d7d06 100644 GIT binary patch delta 187 zcmWm1Jrcn{0D#fi&H5)cf{p*+4(>pq(kNZQ6^wBTTCJIwp)%tZQe-BIG`4XBpW+oS zIqgM)ODgqo^GIWHf6uN@lR5KO^p#fVskhA5tKjUKD7K%8zq9IKm4JkU|8vNrfFepL kqk<}Ga8ZYbhX#B!(Lx&r0XpcShdu@vVubK!)p)!30b>$Oa{vGU delta 187 zcmWm1D-S_Y0KoB`<9J-pbG=`eE83mUpxM|of+Px>Dq?~t2sW8!v(br~ez)6C@e%xm zU-=5TJQUFy)tTRlz>DC|A!Gl o6fszcBY`ARNFxIc8(HL#M*&5YP(}q+)KG_m2AXgmMzt1$AGl6Q)Bpeg diff --git a/web3-credential-server/src/main/java/web3/s3Storage/controller/S3StorageController.java b/web3-credential-server/src/main/java/web3/s3Storage/controller/S3StorageController.java index 59df4e3..040c7d7 100644 --- a/web3-credential-server/src/main/java/web3/s3Storage/controller/S3StorageController.java +++ b/web3-credential-server/src/main/java/web3/s3Storage/controller/S3StorageController.java @@ -97,7 +97,6 @@ public ResponseEntity getPdf( @Parameter(description = "pdf 파일 경로",required = true) @RequestParam("pdfUrl") String pdfUrl) { try { - System.out.println("pdfUrl = " + pdfUrl); byte[] pdfData = s3StorageService.getPdf(pdfUrl).readAllBytes(); return ResponseEntity.ok().contentType(MediaType.APPLICATION_PDF).body(pdfData); } catch (IOException e) { @@ -134,6 +133,7 @@ public ResponseEntity getMetadata( @Parameter(description = "페이지 번호",required = true) @RequestParam int page) { String metadata = s3StorageService.getMetadataForPage(pdfUrl, page); + return ResponseEntity.ok().body(metadata); } diff --git a/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java b/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java index 4e52b16..7560c0a 100644 --- a/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java +++ b/web3-credential-server/src/main/java/web3/s3Storage/service/S3StorageService.java @@ -279,10 +279,12 @@ public String getMetadataForPage(String pdfUrl, int pageNumber) { GetObjectResponse getObjectResponse = s3Client.getObject(getRequest).response(); Map metadata = getObjectResponse.metadata(); + HashMap decodedMetadata = decodeMetadata(metadata); + System.out.println("decodedMetadata = " + decodedMetadata); String pageKey = "page-" + pageNumber; - String result = metadata.get(pageKey); + String result = decodedMetadata.get(pageKey); // 내용 부분만 추출 if (result != null && result.contains(":")) {