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