-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from IT-Cotato/feature/155-refactor-place-api
Feature: 장소 api 변경(#155)
- Loading branch information
Showing
8 changed files
with
236 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 0 additions & 51 deletions
51
backend/src/main/java/middle_point_search/backend/domains/place/dto/PlaceDTO.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
...src/main/java/middle_point_search/backend/domains/place/dto/request/SavePlaceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package middle_point_search.backend.domains.place.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class SavePlaceRequest { | ||
|
||
@NotBlank(message = "siDo는 비어 있을 수 없습니다.") | ||
private String siDo; | ||
|
||
@NotBlank(message = "siGunGu는 비어 있을 수 없습니다.") | ||
private String siGunGu; | ||
|
||
@NotBlank(message = "roadNameAddress는 비어 있을 수 없습니다.") | ||
private String roadNameAddress; | ||
|
||
@NotNull(message = "addressLat는 비어 있을 수 없습니다.") | ||
private Double addressLat; | ||
|
||
@NotNull(message = "addressLong는 비어 있을 수 없습니다.") | ||
private Double addressLong; | ||
} |
30 changes: 30 additions & 0 deletions
30
...c/main/java/middle_point_search/backend/domains/place/dto/request/UpdatePlaceRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package middle_point_search.backend.domains.place.dto.request; | ||
|
||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class UpdatePlaceRequest { | ||
|
||
@NotNull(message = "placeId는 비어 있을 수 없습니다.") | ||
private Long placeId; | ||
|
||
@NotBlank(message = "siDo는 비어 있을 수 없습니다.") | ||
private String siDo; | ||
|
||
@NotBlank(message = "siGunGu는 비어 있을 수 없습니다.") | ||
private String siGunGu; | ||
|
||
@NotBlank(message = "roadNameAddress는 비어 있을 수 없습니다.") | ||
private String roadNameAddress; | ||
|
||
@NotNull(message = "addressLat는 비어 있을 수 없습니다.") | ||
private Double addressLat; | ||
|
||
@NotNull(message = "addressLong는 비어 있을 수 없습니다.") | ||
private Double addressLong; | ||
} |
40 changes: 40 additions & 0 deletions
40
.../main/java/middle_point_search/backend/domains/place/dto/response/FindPlacesResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package middle_point_search.backend.domains.place.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import middle_point_search.backend.domains.place.domain.Place; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class FindPlacesResponse { | ||
|
||
private final Boolean myLocationExistence; | ||
private final List<PlaceVO> myLocations; | ||
private final Boolean friendLocationExistence; | ||
private final List<PlaceVO> friendLocations; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public static class PlaceVO { | ||
private final Long placeId; | ||
private final String siDo; | ||
private final String siGunGu; | ||
private final String roadNameAddress; | ||
private final Double addressLat; | ||
private final Double addressLong; | ||
|
||
public static PlaceVO from(Place place) { | ||
return new PlaceVO( | ||
place.getId(), | ||
place.getSiDo(), | ||
place.getSiGunGu(), | ||
place.getRoadNameAddress(), | ||
place.getAddressLatitude(), | ||
place.getAddressLongitude() | ||
); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.