diff --git a/src/main/java/com/example/howmuch/domain/entity/AcEvent.java b/src/main/java/com/example/howmuch/domain/entity/AcEvent.java index 225883d..4a31b6b 100644 --- a/src/main/java/com/example/howmuch/domain/entity/AcEvent.java +++ b/src/main/java/com/example/howmuch/domain/entity/AcEvent.java @@ -131,4 +131,14 @@ public String getAcEventDisplayName() { } return eventDisplayName; } + + public String getAcEventDisplayNameWithDetail(){ + String eventDisplayName; + if (eventCategory == EventCategory.ETC && eventName != null) { + eventDisplayName = eventName; + } else { + eventDisplayName = eventCategory.getCategoryName(); + } + return eventDisplayName; + } } diff --git a/src/main/java/com/example/howmuch/dto/event/GetAcEventsResponseDto.java b/src/main/java/com/example/howmuch/dto/event/GetAcEventsResponseDto.java index bd0ddc9..9d8ff35 100644 --- a/src/main/java/com/example/howmuch/dto/event/GetAcEventsResponseDto.java +++ b/src/main/java/com/example/howmuch/dto/event/GetAcEventsResponseDto.java @@ -38,7 +38,7 @@ public static GetAcEventsResponseDto of(AcEvent acEvent, int dDay) { .payAmount(acEvent.getPayAmount()) .eventCategory(acEvent.getEventCategory().getValue()) .acType(acEvent.getAcquaintanceType().getValue()) - .acEventDisplayName(acEvent.getAcEventDisplayName()) + .acEventDisplayName(acEvent.getAcEventDisplayNameWithDetail()) .eventTime(acEvent.getEventTime()) .build(); }