Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityMarkerResponse.java
package com.be.sportizebe.domain.facility.dto.response;

import com.be.sportizebe.domain.facility.entity.FacilityType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -16,7 +17,7 @@ public class FacilityMarkerResponse {
private String facilityName;

@Schema(description = "종목", example = "SOCCER")
private String facilityType;
private FacilityType facilityType;

@Schema(description = "위도", example = "37.2869")
private double lat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// src/main/java/com/be/sportizebe/domain/facility/dto/response/FacilityNearResponse.java
package com.be.sportizebe.domain.facility.dto.response;

import com.be.sportizebe.domain.facility.entity.FacilityType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -25,7 +26,7 @@ public class FacilityNearResponse {
private String thumbnailUrl;

@Schema(description = "종목", example = "SOCCER")
private String facilityType;
private FacilityType facilityType;

@Schema(description = "거리(미터)", example = "2178")
private int distanceM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.be.sportizebe.domain.facility.dto.response.FacilityMarkerResponse;
import com.be.sportizebe.domain.facility.dto.response.FacilityNearResponse;
import com.be.sportizebe.domain.facility.dto.response.FacilityResponse;
import com.be.sportizebe.domain.facility.entity.FacilityType;
import com.be.sportizebe.domain.facility.entity.SportsFacility;
import com.be.sportizebe.domain.facility.repository.projection.FacilityMarkerProjection;
import com.be.sportizebe.domain.facility.repository.projection.FacilityNearProjection;
Expand All @@ -16,7 +17,7 @@ static FacilityNearResponse toNearResponse(FacilityNearProjection p){
.address(p.getAddress())
.introduce(p.getIntroduce())
.thumbnailUrl(p.getThumbnailUrl())
.facilityType(p.getFacilityType())
.facilityType(FacilityType.valueOf(p.getFacilityType()))
.distanceM((int) Math.round(p.getDistanceM()))
.build();
}
Expand All @@ -25,9 +26,10 @@ static FacilityMarkerResponse toMarkerResponse(FacilityMarkerProjection p){
return FacilityMarkerResponse.builder()
.id(p.getId())
.facilityName(p.getFacilityName())
.facilityType(p.getFacilityType())
.facilityType(FacilityType.valueOf(p.getFacilityType()))
.lat(p.getLat())
.lng(p.getLng())
.distanceM((int) Math.round(p.getDistanceM()))
.build();
}
static FacilityResponse toFacilityResponse(SportsFacility sf) {
Expand Down