Skip to content

Commit

Permalink
feat: api res에 isActive 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
EunjiShin committed Jul 17, 2024
1 parent 1d39faa commit c55c013
Show file tree
Hide file tree
Showing 4 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 c55c013

Please sign in to comment.