-
Notifications
You must be signed in to change notification settings - Fork 2
[FEAT] api-owner BFF 전환 #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6980ed5
6d22c13
438d337
5924fa6
6de731f
84dbde2
ff56152
641695a
95f75fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.wellmeet.client; | ||
|
|
||
| import com.wellmeet.client.dto.MemberDTO; | ||
| import com.wellmeet.client.dto.request.MemberIdsRequest; | ||
| import java.util.List; | ||
| import org.springframework.cloud.openfeign.FeignClient; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
|
|
||
| @FeignClient(name = "domain-member-service") | ||
| public interface MemberClient { | ||
|
|
||
| @GetMapping("/api/members/{id}") | ||
| MemberDTO getMember(@PathVariable("id") String id); | ||
|
|
||
| @PostMapping("/api/members/batch") | ||
| List<MemberDTO> getMembersByIds(@RequestBody MemberIdsRequest request); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.wellmeet.client; | ||
|
|
||
| import com.wellmeet.client.dto.OwnerDTO; | ||
| import org.springframework.cloud.openfeign.FeignClient; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
|
|
||
| @FeignClient(name = "domain-owner-service") | ||
| public interface OwnerClient { | ||
|
|
||
| @GetMapping("/api/owners/{id}") | ||
| OwnerDTO getOwner(@PathVariable("id") String id); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.wellmeet.client; | ||
|
|
||
| import com.wellmeet.client.dto.ReservationDTO; | ||
| import java.util.List; | ||
| import org.springframework.cloud.openfeign.FeignClient; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PutMapping; | ||
|
|
||
| @FeignClient(name = "domain-reservation-service") | ||
| public interface ReservationClient { | ||
|
|
||
| @GetMapping("/api/reservations/{id}") | ||
| ReservationDTO getReservation(@PathVariable("id") Long id); | ||
|
|
||
| @GetMapping("/api/reservations/restaurant/{restaurantId}") | ||
| List<ReservationDTO> getReservationsByRestaurant(@PathVariable("restaurantId") String restaurantId); | ||
|
|
||
| @PutMapping("/api/reservations/{id}/confirm") | ||
| void confirmReservation(@PathVariable("id") Long id); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package com.wellmeet.client; | ||
|
|
||
| import com.wellmeet.client.dto.AvailableDateDTO; | ||
| import com.wellmeet.client.dto.BusinessHourDTO; | ||
| import com.wellmeet.client.dto.RestaurantDTO; | ||
| import com.wellmeet.client.dto.request.UpdateOperatingHoursDTO; | ||
| import com.wellmeet.client.dto.request.UpdateRestaurantDTO; | ||
| import java.util.List; | ||
| import org.springframework.cloud.openfeign.FeignClient; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PutMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
|
|
||
| @FeignClient(name = "domain-restaurant-service") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain서비스 이름이 Eureka에 등록된 이름과 일치하는지 확인하세요.
다음 스크립트로 서비스 이름 사용을 확인할 수 있습니다: 🏁 Script executed: #!/bin/bash
# Description: Verify service name consistency across Feign clients
# Find all FeignClient annotations and their service names
rg -n '@FeignClient\s*\(\s*name\s*=\s*"[^"]+"\s*\)' -A 1
# Check application properties for service discovery configuration
fd -e yml -e yaml -e properties | xargs rg -n "spring\.application\.name|eureka"Length of output: 3991 🏁 Script executed: #!/bin/bash
# Extract spring.application.name from each domain service configuration
echo "=== domain-restaurant ==="
rg -n "spring:\s*application:\s*name" -A 1 domain-restaurant/src/main/resources/application.yml
echo "=== domain-reservation ==="
rg -n "spring:\s*application:\s*name" -A 1 domain-reservation/src/main/resources/application.yml
echo "=== domain-owner ==="
rg -n "spring:\s*application:\s*name" -A 1 domain-owner/src/main/resources/application.yml
echo "=== domain-member ==="
rg -n "spring:\s*application:\s*name" -A 1 domain-member/src/main/resources/application.ymlLength of output: 95 🏁 Script executed: #!/bin/bash
# Extract application names from YAML files using simpler pattern
echo "=== domain-restaurant application.yml ==="
rg -n "application:" -A 5 domain-restaurant/src/main/resources/application.yml | head -20
echo ""
echo "=== domain-reservation application.yml ==="
rg -n "application:" -A 5 domain-reservation/src/main/resources/application.yml | head -20
echo ""
echo "=== domain-owner application.yml ==="
rg -n "application:" -A 5 domain-owner/src/main/resources/application.yml | head -20
echo ""
echo "=== domain-member application.yml ==="
rg -n "application:" -A 5 domain-member/src/main/resources/application.yml | head -20Length of output: 914 RestaurantClient의 @FeignClient 이름이 Eureka 등록명과 일치하지 않습니다.
수정 필요:
(다른 클라이언트들은 올바르게 구성됨: ReservationClient, OwnerClient, MemberClient) 🤖 Prompt for AI Agents |
||
| public interface RestaurantClient { | ||
|
|
||
| @GetMapping("/api/restaurants/{id}") | ||
| RestaurantDTO getRestaurant(@PathVariable("id") String id); | ||
|
|
||
| @GetMapping("/api/restaurants/{restaurantId}/available-dates/{availableDateId}") | ||
| AvailableDateDTO getAvailableDate( | ||
| @PathVariable("restaurantId") String restaurantId, | ||
| @PathVariable("availableDateId") Long availableDateId | ||
| ); | ||
|
|
||
| @PutMapping("/api/restaurants/{id}") | ||
| RestaurantDTO updateRestaurant( | ||
| @PathVariable("id") String id, | ||
| @RequestBody UpdateRestaurantDTO request | ||
| ); | ||
|
|
||
| @GetMapping("/api/restaurants/{restaurantId}/operating-hours") | ||
| List<BusinessHourDTO> getOperatingHours(@PathVariable("restaurantId") String restaurantId); | ||
|
|
||
| @PutMapping("/api/restaurants/{restaurantId}/operating-hours") | ||
| List<BusinessHourDTO> updateOperatingHours( | ||
| @PathVariable("restaurantId") String restaurantId, | ||
| @RequestBody UpdateOperatingHoursDTO request | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.time.LocalTime; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class AvailableDateDTO { | ||
|
|
||
| private Long id; | ||
| private LocalDate date; | ||
| private LocalTime time; | ||
| private int maxCapacity; | ||
| private boolean isAvailable; | ||
| private String restaurantId; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import java.time.LocalTime; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class BusinessHourDTO { | ||
|
|
||
| private Long id; | ||
| private String dayOfWeek; | ||
| private boolean isOperating; | ||
| private LocalTime open; | ||
| private LocalTime close; | ||
| private LocalTime breakStart; | ||
| private LocalTime breakEnd; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class MemberDTO { | ||
|
|
||
| private String id; | ||
| private String name; | ||
| private String nickname; | ||
| private String email; | ||
| private String phone; | ||
| private boolean reservationEnabled; | ||
| private boolean remindEnabled; | ||
| private boolean reviewEnabled; | ||
| private boolean isVip; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class OwnerDTO { | ||
|
|
||
| private String id; | ||
| private String name; | ||
| private String email; | ||
| private boolean reservationEnabled; | ||
| private boolean reviewEnabled; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class ReservationDTO { | ||
|
|
||
| private Long id; | ||
| private String status; | ||
| private String restaurantId; | ||
| private Long availableDateId; | ||
| private String memberId; | ||
| private int partySize; | ||
| private String specialRequest; | ||
| private LocalDateTime createdAt; | ||
| private LocalDateTime updatedAt; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.wellmeet.client.dto; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class RestaurantDTO { | ||
|
|
||
| private String id; | ||
| private String name; | ||
| private String address; | ||
| private double latitude; | ||
| private double longitude; | ||
| private String thumbnail; | ||
| private String ownerId; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.wellmeet.client.dto.request; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class CreateReservationDTO { | ||
|
|
||
| private String restaurantId; | ||
| private Long availableDateId; | ||
| private String memberId; | ||
| private int partySize; | ||
| private String specialRequest; | ||
| } | ||
|
Comment on lines
+1
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package com.wellmeet.client.dto.request; | ||
|
|
||
| import java.util.List; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class MemberIdsRequest { | ||
|
|
||
| private List<String> memberIds; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package com.wellmeet.client.dto.request; | ||
|
|
||
| import java.time.LocalTime; | ||
| import java.util.List; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class UpdateOperatingHoursDTO { | ||
|
|
||
| private List<DayHoursDTO> operatingHours; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public static class DayHoursDTO { | ||
| private String dayOfWeek; | ||
| private boolean isOperating; | ||
| private LocalTime open; | ||
| private LocalTime close; | ||
| private LocalTime breakStart; | ||
| private LocalTime breakEnd; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package com.wellmeet.client.dto.request; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| public class UpdateRestaurantDTO { | ||
|
|
||
| private String name; | ||
| private String address; | ||
| private double latitude; | ||
| private double longitude; | ||
| private String thumbnail; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
도메인 모듈에서 Feign 클라이언트로의 마이그레이션 확인 필요
Spring Cloud OpenFeign과 Eureka 클라이언트가 추가되고 도메인 모듈 의존성이 제거되었습니다. 이는 BFF 아키텍처로의 중요한 전환입니다. 모든 도메인 모듈 사용처가 Feign 클라이언트로 제대로 마이그레이션되었는지 확인이 필요합니다.
다음 스크립트를 실행하여 제거된 도메인 모듈의 import 문이 남아있는지 확인하세요:
🏁 Script executed:
Length of output: 332
🏁 Script executed:
Length of output: 293
🏁 Script executed:
Length of output: 413
🏁 Script executed:
Length of output: 1450
도메인 모듈 의존성 제거 후 RestaurantRedisService import 미정리
도메인 모듈 의존성이
build.gradle에서 제거되었지만, 여전히 도메인 모듈의RestaurantRedisService를 직접 import하고 있습니다. 이는 런타임 에러를 야기할 수 있습니다.api-owner/src/main/java/com/wellmeet/global/event/listener/RestaurantEventListener.java:4-import com.wellmeet.restaurant.RestaurantRedisService;api-owner/src/test/java/com/wellmeet/global/event/listener/RestaurantEventListenerTest.java:6- 테스트 코드도 동일Feign 클라이언트로 마이그레이션하거나 도메인 모듈 의존성을 유지해야 합니다.
🤖 Prompt for AI Agents