Skip to content

Commit

Permalink
[BSVR-131] 전체 경기장 이름 조회 API에 isActive 필드 추가 (#40)
Browse files Browse the repository at this point in the history
* feat: application.yml 경로 변경

* feat: api res에 isActive 추가
  • Loading branch information
EunjiShin authored Jul 17, 2024
1 parent 62a5b24 commit 875e569
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<StadiumHomeTeamInfoResponse> findAllStadiums() {
public List<StadiumNameInfoResponse> findAllNames() {
List<StadiumNameInfo> 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();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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) {}
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ class StadiumInfoWithSeatChart {
class StadiumNameInfo {
private final Long id;
private final String name;
private final boolean isActive;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ public List<StadiumHomeTeamInfo> findAllStadiums() {
@Override
public List<StadiumNameInfo> findAllNames() {
List<Stadium> 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
Expand Down

0 comments on commit 875e569

Please sign in to comment.