From 61e9f7c004dba996befd9d7dc5aabff226abc7d7 Mon Sep 17 00:00:00 2001 From: Gyoungmin Kim Date: Sat, 20 Jul 2024 17:06:05 +0900 Subject: [PATCH] feat : add getMyFourCutFiles base codes (#43) * feat : add MY_FOUR_CUT in BrandType enum --- .../src/main/java/kr/mafoo/photo/domain/BrandType.java | 1 + .../src/main/java/kr/mafoo/photo/service/QrService.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/photo-service/src/main/java/kr/mafoo/photo/domain/BrandType.java b/photo-service/src/main/java/kr/mafoo/photo/domain/BrandType.java index 141e04e..d78c789 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/domain/BrandType.java +++ b/photo-service/src/main/java/kr/mafoo/photo/domain/BrandType.java @@ -7,6 +7,7 @@ public enum BrandType { PHOTOISM(Pattern.compile("https://qr\\.seobuk\\.kr/.*")), HARU_FILM(Pattern.compile("http://haru\\d+\\.mx\\d+\\.co\\.kr/.*")), DONT_LOOK_UP(Pattern.compile("https://x\\.dontlxxkup\\.kr/.*")), + MY_FOUR_CUT(Pattern.compile("https://firebasestorage\\.googleapis\\.com:443/v0/b/my4ccu\\.appspot\\.com/.*")), ; private final Pattern urlPattern; diff --git a/photo-service/src/main/java/kr/mafoo/photo/service/QrService.java b/photo-service/src/main/java/kr/mafoo/photo/service/QrService.java index 5140f51..30baaae 100644 --- a/photo-service/src/main/java/kr/mafoo/photo/service/QrService.java +++ b/photo-service/src/main/java/kr/mafoo/photo/service/QrService.java @@ -33,6 +33,7 @@ public Mono getFileFromQrUrl(String qrUrl) { case PHOTOISM -> createFileDto(brandType, getPhotoismFiles(qrUrl)); case HARU_FILM -> createFileDto(brandType, getHaruFilmFiles(qrUrl)); case DONT_LOOK_UP -> createFileDto(brandType, getDontLookUpFiles(qrUrl)); + case MY_FOUR_CUT -> createFileDto(brandType, getMyFourCutFiles(qrUrl)); }; } @@ -118,6 +119,10 @@ private Mono getDontLookUpFiles(String qrUrl) { ); } + private Mono getMyFourCutFiles(String qrUrl) { + return getFileAsByte(qrUrl); + } + private Mono getRedirectUri(String url) { return externalWebClient .get()