Skip to content

Commit ddd642a

Browse files
authored
Merge 0f8ed13 into 298a3db
2 parents 298a3db + 0f8ed13 commit ddd642a

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/main/java/sevenstar/marineleisure/activity/dto/reponse/ActivitySummaryResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
@Builder
77
public record ActivitySummaryResponse(
88
String spotName,
9-
TotalIndex totalIndex
9+
TotalIndex totalIndex,
10+
Long spotId
1011
) {
1112
}

src/main/java/sevenstar/marineleisure/activity/service/ActivityService.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@ private Map<String, ActivitySummaryResponse> getLocalActivitySummary(BigDecimal
6161

6262
SpotPreviewReadResponse preview = spotService.preview(latitude.floatValue(), longitude.floatValue());
6363
responses.put("Fishing",
64-
new ActivitySummaryResponse(preview.fishing().getName(), preview.fishing().getTotalIndex()));
64+
new ActivitySummaryResponse(preview.fishing().getName(), preview.fishing().getTotalIndex(),preview.fishing()
65+
.getSpotId()));
6566
responses.put("Mudflat",
66-
new ActivitySummaryResponse(preview.mudflat().getName(), preview.mudflat().getTotalIndex()));
67+
new ActivitySummaryResponse(preview.mudflat().getName(), preview.mudflat().getTotalIndex(),preview.mudflat()
68+
.getSpotId()));
6769
responses.put("Surfing",
68-
new ActivitySummaryResponse(preview.surfing().getName(), preview.surfing().getTotalIndex()));
69-
responses.put("Scuba", new ActivitySummaryResponse(preview.scuba().getName(), preview.scuba().getTotalIndex()));
70+
new ActivitySummaryResponse(preview.surfing().getName(), preview.surfing().getTotalIndex(),preview.surfing()
71+
.getSpotId()));
72+
responses.put("Scuba", new ActivitySummaryResponse(preview.scuba().getName(), preview.scuba().getTotalIndex(),preview.scuba()
73+
.getSpotId()));
7074

7175
// Fishing fishingBySpot = null;
7276
// Mudflat mudflatBySpot = null;
@@ -151,25 +155,25 @@ private Map<String, ActivitySummaryResponse> getGlobalActivitySummary() {
151155
if (fishingResult.isPresent()) {
152156
Fishing fishing = fishingResult.get();
153157
OutdoorSpot spot = outdoorSpotRepository.findById(fishing.getSpotId()).get();
154-
responses.put("Fishing", new ActivitySummaryResponse(spot.getName(), fishing.getTotalIndex()));
158+
responses.put("Fishing", new ActivitySummaryResponse(spot.getName(), fishing.getTotalIndex(),fishing.getSpotId()));
155159
}
156160

157161
if (mudflatResult.isPresent()) {
158162
Mudflat mudflat = mudflatResult.get();
159163
OutdoorSpot spot = outdoorSpotRepository.findById(mudflat.getSpotId()).get();
160-
responses.put("Mudflat", new ActivitySummaryResponse(spot.getName(), mudflat.getTotalIndex()));
164+
responses.put("Mudflat", new ActivitySummaryResponse(spot.getName(), mudflat.getTotalIndex(),mudflat.getSpotId()));
161165
}
162166

163167
if (scubaResult.isPresent()) {
164168
Scuba scuba = scubaResult.get();
165169
OutdoorSpot spot = outdoorSpotRepository.findById(scuba.getSpotId()).get();
166-
responses.put("Scuba", new ActivitySummaryResponse(spot.getName(), scuba.getTotalIndex()));
170+
responses.put("Scuba", new ActivitySummaryResponse(spot.getName(), scuba.getTotalIndex(),scuba.getSpotId()));
167171
}
168172

169173
if (surfingResult.isPresent()) {
170174
Surfing surfing = surfingResult.get();
171175
OutdoorSpot spot = outdoorSpotRepository.findById(surfing.getSpotId()).get();
172-
responses.put("Surfing", new ActivitySummaryResponse(spot.getName(), surfing.getTotalIndex()));
176+
responses.put("Surfing", new ActivitySummaryResponse(spot.getName(), surfing.getTotalIndex(),surfing.getSpotId()));
173177
}
174178

175179
return responses;

0 commit comments

Comments
 (0)