From 06f8279bb2d171241051c3482b2afa0dc7676308 Mon Sep 17 00:00:00 2001 From: redblackblossom Date: Tue, 13 Aug 2024 23:06:18 +0900 Subject: [PATCH] =?UTF-8?q?refact=20:=20=EB=8B=A4=EC=9A=B4=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=ED=83=9C=EA=B7=B8=20=EC=B6=94=EA=B0=80=20=EC=8B=9C?= =?UTF-8?q?=20=EC=82=AC=EC=A7=84=EC=9D=98=20url=EC=9D=84=20=ED=86=B5?= =?UTF-8?q?=ED=95=B4=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8=20=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/PhotoEsClientRepository.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java index e28a209..fd6f43d 100644 --- a/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java +++ b/src/main/java/com/umc/naoman/domain/photo/elasticsearch/repository/PhotoEsClientRepository.java @@ -269,20 +269,18 @@ public List deletePhotoEsByShareGroupId(Long shareGroupId) { } //특정 사진에 특정 맴버 다운로드 태그 추가 - public void addDownloadTag(List photoEs, Long memberId){ - List fieldValueList = photoEs.stream() - .map(photo -> FieldValue.of(photo.getName())) + public void addDownloadTag(List photoUrlList, Long memberId){ + List fieldValueList = photoUrlList.stream() + .map(FieldValue::of) .toList(); - String routing = photoEs.get(0).getShareGroupId().toString(); Map params = new HashMap<>(); params.put("memberId", JsonData.of(memberId)); try { elasticsearchClient.updateByQuery(u -> u .index("photos_es") - .routing(routing) .query(q -> q .terms(t -> t - .field("name") + .field("url") .terms(te -> te.value(fieldValueList)) ) )