From 680204769c5c76b12179f989dd3373bb8d2e01ce Mon Sep 17 00:00:00 2001 From: Byuk_mm Date: Fri, 30 Aug 2024 22:03:42 +0900 Subject: [PATCH] =?UTF-8?q?[feat][#95]=20=EC=9D=B8=EC=84=B1=20=ED=83=9C?= =?UTF-8?q?=EA=B7=B8=20=EC=A1=B0=ED=9A=8C=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/server/bbo_gak/domain/card/dao/TagRepository.java | 2 +- .../com/server/bbo_gak/domain/card/service/TagService.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java b/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java index 223bf3e..a7a8794 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java +++ b/src/main/java/com/server/bbo_gak/domain/card/dao/TagRepository.java @@ -7,7 +7,7 @@ public interface TagRepository extends JpaRepository { - List findAllByJob(Job job); + List findAllByJobIsIn(List jobList); List findAllByIdIsNotIn(List idList); diff --git a/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java b/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java index a21c4bc..501411a 100644 --- a/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java +++ b/src/main/java/com/server/bbo_gak/domain/card/service/TagService.java @@ -7,6 +7,7 @@ import com.server.bbo_gak.domain.card.entity.Card; import com.server.bbo_gak.domain.card.entity.CardTag; import com.server.bbo_gak.domain.card.entity.Tag; +import com.server.bbo_gak.domain.user.entity.Job; import com.server.bbo_gak.domain.user.entity.User; import com.server.bbo_gak.global.error.exception.BusinessException; import com.server.bbo_gak.global.error.exception.ErrorCode; @@ -27,7 +28,7 @@ public class TagService { @Transactional(readOnly = true) public List getAllTagList(User user) { - return tagRepository.findAllByJob(user.getJob()).stream() + return tagRepository.findAllByJobIsIn(List.of(user.getJob(), Job.ALL)).stream() .map(TagGetResponse::from) .toList(); }