From d6a8347c1d5ef3de035a0919f5fb84a3c68ce4ee Mon Sep 17 00:00:00 2001 From: HaYeon52 Date: Tue, 26 May 2026 16:49:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Place=20DTO=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/CouplePage.tsx | 5 ++++ frontend/src/pages/LoginPage.tsx | 5 ++++ frontend/src/pages/MapPage.tsx | 5 ++++ frontend/src/pages/RecordCreatePage.tsx | 5 ++++ frontend/src/pages/SignupPage.tsx | 5 ++++ frontend/src/pages/TimelinePage.tsx | 5 ++++ .../place/presentation/PlaceController.java | 22 +++++++-------- .../presentation/dto/PlaceRequestDto.java | 17 +++++++++++ .../presentation/dto/PlaceResponseDto.java | 28 +++++++++++++++++++ 9 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 frontend/src/pages/CouplePage.tsx create mode 100644 frontend/src/pages/LoginPage.tsx create mode 100644 frontend/src/pages/MapPage.tsx create mode 100644 frontend/src/pages/RecordCreatePage.tsx create mode 100644 frontend/src/pages/SignupPage.tsx create mode 100644 frontend/src/pages/TimelinePage.tsx create mode 100644 src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceRequestDto.java create mode 100644 src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceResponseDto.java diff --git a/frontend/src/pages/CouplePage.tsx b/frontend/src/pages/CouplePage.tsx new file mode 100644 index 0000000..fd8a666 --- /dev/null +++ b/frontend/src/pages/CouplePage.tsx @@ -0,0 +1,5 @@ +function CouplePage() { + return
연인 페이지
; +} + +export default CouplePage; \ No newline at end of file diff --git a/frontend/src/pages/LoginPage.tsx b/frontend/src/pages/LoginPage.tsx new file mode 100644 index 0000000..41b9ef4 --- /dev/null +++ b/frontend/src/pages/LoginPage.tsx @@ -0,0 +1,5 @@ +function LoginPage() { + return
로그인 페이지
; +} + +export default LoginPage; \ No newline at end of file diff --git a/frontend/src/pages/MapPage.tsx b/frontend/src/pages/MapPage.tsx new file mode 100644 index 0000000..0702e68 --- /dev/null +++ b/frontend/src/pages/MapPage.tsx @@ -0,0 +1,5 @@ +function MapPage() { + return
지도 페이지
; +} + +export default MapPage; \ No newline at end of file diff --git a/frontend/src/pages/RecordCreatePage.tsx b/frontend/src/pages/RecordCreatePage.tsx new file mode 100644 index 0000000..ea028e1 --- /dev/null +++ b/frontend/src/pages/RecordCreatePage.tsx @@ -0,0 +1,5 @@ +function RecordCreatePage() { + return
기록 작성 페이지
; +} + +export default RecordCreatePage; \ No newline at end of file diff --git a/frontend/src/pages/SignupPage.tsx b/frontend/src/pages/SignupPage.tsx new file mode 100644 index 0000000..dc4d5b6 --- /dev/null +++ b/frontend/src/pages/SignupPage.tsx @@ -0,0 +1,5 @@ +function SignupPage() { + return
회원가입 페이지
; +} + +export default SignupPage; \ No newline at end of file diff --git a/frontend/src/pages/TimelinePage.tsx b/frontend/src/pages/TimelinePage.tsx new file mode 100644 index 0000000..fed8234 --- /dev/null +++ b/frontend/src/pages/TimelinePage.tsx @@ -0,0 +1,5 @@ +function TimelinePage() { + return
타임라인 페이지
; +} + +export default TimelinePage; \ No newline at end of file diff --git a/src/main/java/com/hanyang/lovepin/place/presentation/PlaceController.java b/src/main/java/com/hanyang/lovepin/place/presentation/PlaceController.java index 7cef1ab..c11164a 100644 --- a/src/main/java/com/hanyang/lovepin/place/presentation/PlaceController.java +++ b/src/main/java/com/hanyang/lovepin/place/presentation/PlaceController.java @@ -2,11 +2,11 @@ import com.hanyang.lovepin.place.application.PlaceService; import com.hanyang.lovepin.place.domain.Place; +import com.hanyang.lovepin.place.presentation.dto.PlaceRequestDto; +import com.hanyang.lovepin.place.presentation.dto.PlaceResponseDto; import lombok.RequiredArgsConstructor; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; -import java.math.BigDecimal; -import java.util.Map; @RestController @RequestMapping("/api/places") @@ -16,16 +16,16 @@ public class PlaceController { private final PlaceService placeService; @PostMapping - public ResponseEntity> findOrCreate(@RequestBody Map body) { + public ResponseEntity findOrCreate(@RequestBody PlaceRequestDto request) { Place place = placeService.findOrCreate( - body.get("kakaoPlaceId"), - body.get("placeName"), - body.get("address"), - new BigDecimal(body.get("latitude")), - new BigDecimal(body.get("longitude")), - body.get("city"), - body.get("district") + request.getKakaoPlaceId(), + request.getPlaceName(), + request.getAddress(), + request.getLatitude(), + request.getLongitude(), + request.getCity(), + request.getDistrict() ); - return ResponseEntity.ok(Map.of("placeId", place.getPlaceId())); + return ResponseEntity.ok(new PlaceResponseDto(place)); } } \ No newline at end of file diff --git a/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceRequestDto.java b/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceRequestDto.java new file mode 100644 index 0000000..9956f51 --- /dev/null +++ b/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceRequestDto.java @@ -0,0 +1,17 @@ +package com.hanyang.lovepin.place.presentation.dto; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import java.math.BigDecimal; + +@Getter +@NoArgsConstructor +public class PlaceRequestDto { + private String kakaoPlaceId; + private String placeName; + private String address; + private BigDecimal latitude; + private BigDecimal longitude; + private String city; + private String district; +} \ No newline at end of file diff --git a/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceResponseDto.java b/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceResponseDto.java new file mode 100644 index 0000000..6218135 --- /dev/null +++ b/src/main/java/com/hanyang/lovepin/place/presentation/dto/PlaceResponseDto.java @@ -0,0 +1,28 @@ +package com.hanyang.lovepin.place.presentation.dto; + +import com.hanyang.lovepin.place.domain.Place; +import lombok.Getter; +import java.math.BigDecimal; + +@Getter +public class PlaceResponseDto { + private Long placeId; + private String kakaoPlaceId; + private String placeName; + private String address; + private BigDecimal latitude; + private BigDecimal longitude; + private String city; + private String district; + + public PlaceResponseDto(Place place) { + this.placeId = place.getPlaceId(); + this.kakaoPlaceId = place.getKakaoPlaceId(); + this.placeName = place.getPlaceName(); + this.address = place.getAddress(); + this.latitude = place.getLatitude(); + this.longitude = place.getLongitude(); + this.city = place.getCity(); + this.district = place.getDistrict(); + } +} \ No newline at end of file