From fd2d7f5c4f9f2914e9f5d5e5d110c64b979a04ed Mon Sep 17 00:00:00 2001 From: Joowon Lim Date: Thu, 7 Mar 2024 21:37:44 +0900 Subject: [PATCH] =?UTF-8?q?Feat:=20=EA=B0=80=EA=B2=8C=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/readyvery/readyverydemo/domain/Store.java | 7 +++++++ .../readyvery/readyverydemo/src/board/dto/BoardMapper.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/readyvery/readyverydemo/domain/Store.java b/src/main/java/com/readyvery/readyverydemo/domain/Store.java index bc15655..f25fa03 100644 --- a/src/main/java/com/readyvery/readyverydemo/domain/Store.java +++ b/src/main/java/com/readyvery/readyverydemo/domain/Store.java @@ -3,6 +3,8 @@ import java.util.ArrayList; import java.util.List; +import org.hibernate.annotations.ColumnDefault; + import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -81,6 +83,11 @@ public class Store extends BaseTimeEntity { @Enumerated(EnumType.STRING) private Grade grade; + // 삭제 여부 + @Column + @ColumnDefault("false") + private boolean isDeleted; + //가게 사장님 연관관계 매핑 @OneToMany(mappedBy = "store") private List ceoInfos = new ArrayList(); diff --git a/src/main/java/com/readyvery/readyverydemo/src/board/dto/BoardMapper.java b/src/main/java/com/readyvery/readyverydemo/src/board/dto/BoardMapper.java index 9519131..41a7aac 100644 --- a/src/main/java/com/readyvery/readyverydemo/src/board/dto/BoardMapper.java +++ b/src/main/java/com/readyvery/readyverydemo/src/board/dto/BoardMapper.java @@ -30,7 +30,7 @@ public BoardSearchRes toBoardSearchRes(List stores) { throw new BusinessLogicException(ExceptionCode.STORE_NOT_FOUND); } return BoardSearchRes.builder() - .stores(stores.stream().map(this::toSearchStoreDto).toList()) + .stores(stores.stream().filter(store -> !store.isDeleted()).map(this::toSearchStoreDto).toList()) .build(); }