Skip to content

Commit

Permalink
Merge pull request #136 from My-Own-Weapon/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rlawogkr authored Jul 25, 2024
2 parents f4439a7 + 6aafd07 commit 82adef3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class StoreController {
* url : /map?left={left}&right={right}&up={up}&down={down}
* ex : map?left=1&right=20&up=1&down=20
* */
// TODO: 여기서 해당 좌표 내부에 있는 식당 중 방송이 진행 중인지에 대한 boolean 값도 return.
@GetMapping("/map")
@Operation(summary = "좌표에 맞는 식당 좌표 조회")
public ResponseEntity<List<StoreResponse>> findStores(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ public class StoreResponse {
private Long storeId;
private double posx;
private double posy;
// store에서 live 중인지에 대한 정보
private boolean isLiveStore;

public StoreResponse(Store store){
public StoreResponse(Store store, boolean isLiveStore){
this.posx = store.getStoreLocation().getPosx();
this.posy = store.getStoreLocation().getPosy();
this.storeAddress = store.getStoreLocation().getAddress();
this.storeName = store.getStoreName();
this.storeId = store.getId();
this.isLiveStore = isLiveStore;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class StoreService {

public List<StoreResponse> getStoresByScreen(String left, String right, String up, String down) {
return storeRepository.findAllByScreen(left,right,up,down).stream()
.map(store -> (new StoreResponse(store)))
.map(store -> (new StoreResponse(store, (liveRoomRepository.findByStoreId(store.getId()).isEmpty()) ? false : true)))
.collect(Collectors.toList());
}

Expand Down

0 comments on commit 82adef3

Please sign in to comment.