From 875e5696ea89ed3ab6ef7c6bb3cd10347baa8821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9A=B0=EB=94=94?= <38103085+EunjiShin@users.noreply.github.com> Date: Thu, 18 Jul 2024 01:28:08 +0900 Subject: [PATCH] =?UTF-8?q?[BSVR-131]=20=EC=A0=84=EC=B2=B4=20=EA=B2=BD?= =?UTF-8?q?=EA=B8=B0=EC=9E=A5=20=EC=9D=B4=EB=A6=84=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?API=EC=97=90=20isActive=20=ED=95=84=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(#40)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: application.yml 경로 변경 * feat: api res에 isActive 추가 --- .../spot/application/stadium/StadiumReadController.java | 2 +- .../stadium/dto/response/StadiumNameInfoResponse.java | 2 +- .../application.yaml => resources/application-ncp.yaml} | 0 .../spot/usecase/port/in/stadium/StadiumReadUsecase.java | 1 + .../spot/usecase/service/stadium/StadiumReadService.java | 4 +++- 5 files changed, 6 insertions(+), 3 deletions(-) rename infrastructure/ncp/src/main/{java/org/depromeet/spot/ncp/resources/application.yaml => resources/application-ncp.yaml} (100%) diff --git a/application/src/main/java/org/depromeet/spot/application/stadium/StadiumReadController.java b/application/src/main/java/org/depromeet/spot/application/stadium/StadiumReadController.java index 4eb01c74..46f31427 100644 --- a/application/src/main/java/org/depromeet/spot/application/stadium/StadiumReadController.java +++ b/application/src/main/java/org/depromeet/spot/application/stadium/StadiumReadController.java @@ -46,7 +46,7 @@ public List findAllStadiums() { public List findAllNames() { List infos = stadiumReadUsecase.findAllNames(); return infos.stream() - .map(t -> new StadiumNameInfoResponse(t.getId(), t.getName())) + .map(t -> new StadiumNameInfoResponse(t.getId(), t.getName(), t.isActive())) .toList(); } diff --git a/application/src/main/java/org/depromeet/spot/application/stadium/dto/response/StadiumNameInfoResponse.java b/application/src/main/java/org/depromeet/spot/application/stadium/dto/response/StadiumNameInfoResponse.java index 7606a081..e6d6f47c 100644 --- a/application/src/main/java/org/depromeet/spot/application/stadium/dto/response/StadiumNameInfoResponse.java +++ b/application/src/main/java/org/depromeet/spot/application/stadium/dto/response/StadiumNameInfoResponse.java @@ -1,3 +1,3 @@ package org.depromeet.spot.application.stadium.dto.response; -public record StadiumNameInfoResponse(Long id, String name) {} +public record StadiumNameInfoResponse(Long id, String name, boolean isActive) {} diff --git a/infrastructure/ncp/src/main/java/org/depromeet/spot/ncp/resources/application.yaml b/infrastructure/ncp/src/main/resources/application-ncp.yaml similarity index 100% rename from infrastructure/ncp/src/main/java/org/depromeet/spot/ncp/resources/application.yaml rename to infrastructure/ncp/src/main/resources/application-ncp.yaml diff --git a/usecase/src/main/java/org/depromeet/spot/usecase/port/in/stadium/StadiumReadUsecase.java b/usecase/src/main/java/org/depromeet/spot/usecase/port/in/stadium/StadiumReadUsecase.java index be5bd764..d80b5e74 100644 --- a/usecase/src/main/java/org/depromeet/spot/usecase/port/in/stadium/StadiumReadUsecase.java +++ b/usecase/src/main/java/org/depromeet/spot/usecase/port/in/stadium/StadiumReadUsecase.java @@ -49,5 +49,6 @@ class StadiumInfoWithSeatChart { class StadiumNameInfo { private final Long id; private final String name; + private final boolean isActive; } } diff --git a/usecase/src/main/java/org/depromeet/spot/usecase/service/stadium/StadiumReadService.java b/usecase/src/main/java/org/depromeet/spot/usecase/service/stadium/StadiumReadService.java index 471d24e2..82ca5cb3 100644 --- a/usecase/src/main/java/org/depromeet/spot/usecase/service/stadium/StadiumReadService.java +++ b/usecase/src/main/java/org/depromeet/spot/usecase/service/stadium/StadiumReadService.java @@ -55,7 +55,9 @@ public List findAllStadiums() { @Override public List findAllNames() { List stadiums = stadiumRepository.findAll(); - return stadiums.stream().map(s -> new StadiumNameInfo(s.getId(), s.getName())).toList(); + return stadiums.stream() + .map(s -> new StadiumNameInfo(s.getId(), s.getName(), s.isActive())) + .toList(); } @Override