[feature/40-dot-image-api] - 음식 도트 선택 조회/추가/삭제 API 구현#41
[feature/40-dot-image-api] - 음식 도트 선택 조회/추가/삭제 API 구현#41Parkchanyoung0710 merged 4 commits intodevelopfrom
Conversation
📝 WalkthroughWalkthrough인증된 사용자가 선호 음식점(food dot)을 조회·추가·제거할 수 있도록 UsersController, 관련 DTO·서비스·모듈 변경과 User 스키마 필드 추가, 주석·시드 데이터 수정을 포함한 기능 추가 및 관련 정리가 이루어졌습니다. Changes
Sequence DiagramsequenceDiagram
participant Client as Client
participant Controller as UsersController
participant Auth as AuthService
participant Service as UsersService
participant DB as Database
Client->>Controller: GET /users/me/food-dots (쿠키)
Controller->>Auth: accessToken 검증
Auth-->>Controller: userId
Controller->>Service: getMyFoodDots(userId)
Service->>DB: 사용자 조회
DB-->>Service: selectedFoodDotIds 반환
Service-->>Controller: 음식점 목록
Controller-->>Client: 응답 (Cache-Control: no-store)
Client->>Controller: POST /users/me/food-dots {dotId}
Controller->>Auth: accessToken 검증
Auth-->>Controller: userId
Controller->>Service: addFoodDot(userId, dotId)
Service->>DB: 사용자 조회
Service->>Service: 중복/최대 개수 검증
Service->>DB: 업데이트 저장
DB-->>Service: 저장 완료
Service-->>Controller: 업데이트된 목록
Controller-->>Client: 추가 완료 응답
Client->>Controller: DELETE /users/me/food-dots/:dotId
Controller->>Auth: accessToken 검증
Auth-->>Controller: userId
Controller->>Service: removeFoodDot(userId, dotId)
Service->>DB: 사용자 조회 및 삭제 후 저장
DB-->>Service: 저장 완료
Service-->>Controller: 업데이트된 목록
Controller-->>Client: 제거 완료 응답
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Pull request overview
사용자 프로필에 “음식 도트(Food Dots)” 선택 정보를 저장/조회/추가/삭제할 수 있도록 Users 도메인에 필드를 추가하고 관련 API 엔드포인트를 구현한 PR입니다. 최대 선택 개수를 9개로 제한해 프론트/백 간 데이터 불일치 가능성을 줄이려는 목적에 해당합니다.
Changes:
- User 스키마에
selectedFoodDotIds: string[]필드 추가 - 내 음식 도트 조회/추가/삭제용 Users API 및 서비스 로직 추가
- 메뉴 시드 데이터 일부 수정 및 부트스트랩 주석 정리
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/users/users.service.ts | 음식 도트 조회/추가/삭제 서비스 메서드 추가 및 최대 9개 제한 적용 |
| src/users/users.module.ts | UsersController 등록 및 AuthModule 의존성 추가(forwardRef) |
| src/users/users.controller.ts | /users/me/food-dots 조회/추가/삭제 엔드포인트 신규 추가 |
| src/users/schemas/user.schema.ts | selectedFoodDotIds 필드 스키마에 추가 |
| src/menus/seed/menu.seed.ts | 시드 메뉴명 1건 변경 |
| src/main.ts | 주석 정리(동작 변경 없음) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
제안 이유
설계 방향
Summary by CodeRabbit
릴리스 노트
새로운 기능
데이터 업데이트