Skip to content

Comments

Feat/#100 마이페이지 API 연결#120

Merged
y-eonee merged 4 commits intodevelopfrom
feat#100-마이페이지-api
Jan 20, 2026

Hidden character warning

The head ref may contain hidden characters: "feat#100-\ub9c8\uc774\ud398\uc774\uc9c0-api"
Merged

Feat/#100 마이페이지 API 연결#120
y-eonee merged 4 commits intodevelopfrom
feat#100-마이페이지-api

Conversation

@y-eonee
Copy link
Contributor

@y-eonee y-eonee commented Jan 20, 2026

🔗 연결된 이슈

📄 작업 내용

  • 마이페이지 API 연결했습니다
  • 별거없어서.... 함 보세염
구현 내용 IPhone 13 mini
GIF

@y-eonee y-eonee requested a review from a team January 20, 2026 14:58
@y-eonee y-eonee self-assigned this Jan 20, 2026
@y-eonee y-eonee requested review from soseoyo12, sum130 and wotjs020708 and removed request for a team January 20, 2026 14:58
@y-eonee y-eonee added 나연🐹 Feature 새로운 기능 구현 및 API 연결 labels Jan 20, 2026
@y-eonee y-eonee linked an issue Jan 20, 2026 that may be closed by this pull request
1 task
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Warning

Rate limit exceeded

@y-eonee has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 31 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1183941 and 632ef3a.

📒 Files selected for processing (13)
  • Cherrish-iOS/Cherrish-iOS/Data/DataDependencyAssembler.swift
  • Cherrish-iOS/Cherrish-iOS/Data/Model/UserInfoResponseDTO.swift
  • Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/MyPageAPI.swift
  • Cherrish-iOS/Cherrish-iOS/Data/Repository/MyPageRepository.swift
  • Cherrish-iOS/Cherrish-iOS/Domain/DomainDependencyAssembler.swift
  • Cherrish-iOS/Cherrish-iOS/Domain/Interface/MyPageInterface.swift
  • Cherrish-iOS/Cherrish-iOS/Domain/Model/UserInfoEntity.swift
  • Cherrish-iOS/Cherrish-iOS/Domain/UseCase/FetchUserInfoUseCase.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageView.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageViewModel.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/Feature/Onboarding/SplashView.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/PresentationDependencyAssembler.swift
  • Cherrish-iOS/Cherrish-iOS/Presentation/ViewFactory.swift
📝 Walkthrough

Walkthrough

사용자 정보 조회 API를 마이페이지에 연결하는 기능을 구현합니다. 데이터, 도메인, 프레젠테이션 계층에 걸쳐 저장소, 유스케이스, 뷰모델 및 관련 의존성 주입 설정을 추가합니다.

Changes

Cohort / File(s) 변경 사항
Data Layer - API 및 DTO
Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/MyPageAPI.swift, Cherrish-iOS/Cherrish-iOS/Data/Model/UserInfoResponseDTO.swift
MyPage API 엔드포인트 정의 추가 (GET /users) 및 사용자 정보 응답 DTO 생성. toEntity() 메서드로 도메인 엔티티로 매핑
Data Layer - Repository 및 DI
Cherrish-iOS/Cherrish-iOS/Data/Repository/MyPageRepository.swift, Cherrish-iOS/Cherrish-iOS/Data/DataDependencyAssembler.swift
DefaultMyPageRepository 구현으로 UserDefaultService에서 userID 조회 후 API 호출. 의존성 어셈블러에 UserDefaultService 추가
Domain Layer - 인터페이스, 엔티티, 유스케이스
Cherrish-iOS/Cherrish-iOS/Domain/Interface/MyPageInterface.swift, Cherrish-iOS/Cherrish-iOS/Domain/Model/UserInfoEntity.swift, Cherrish-iOS/Cherrish-iOS/Domain/UseCase/FetchUserInfoUseCase.swift, Cherrish-iOS/Cherrish-iOS/Domain/DomainDependencyAssembler.swift
MyPageInterface 프로토콜, UserInfoEntity 엔티티, FetchUserInfoUseCase 및 구현체 추가. 도메인 의존성 어셈블러에 유스케이스 등록
Presentation Layer - ViewModel 및 View
Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageViewModel.swift, Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageView.swift
사용자 정보 상태를 관리하는 MyPageViewModel 추가. MyPageView에 뷰모델 주입 및 비동기 데이터 페칭 로직 추가
Presentation Layer - DI 및 ViewFactory
Cherrish-iOS/Cherrish-iOS/Presentation/PresentationDependencyAssembler.swift, Cherrish-iOS/Cherrish-iOS/Presentation/ViewFactory.swift
프레젠테이션 계층 의존성 어셈블러에 뷰모델 등록. ViewFactory에서 뷰모델 해결 및 주입 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant View as MyPageView
    participant ViewModel as MyPageViewModel
    participant UseCase as FetchUserInfoUseCase
    participant Repository as DefaultMyPageRepository
    participant UserDefaults as UserDefaultService
    participant API as MyPageAPI

    View->>ViewModel: .task { fetchUserInfo() }
    ViewModel->>UseCase: execute()
    UseCase->>Repository: fetchUserInfo()
    Repository->>UserDefaults: userID 조회
    UserDefaults-->>Repository: userID (기본값: 1)
    Repository->>API: MyPageAPI.users(userID)
    API-->>Repository: UserInfoResponseDTO
    Repository->>Repository: toEntity() 변환
    Repository-->>UseCase: UserInfoEntity
    UseCase-->>ViewModel: UserInfoEntity
    ViewModel->>ViewModel: `@Published` name, day 업데이트
    ViewModel-->>View: 상태 변경 알림
    View->>View: name, day 화면 렌더링
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

Suggested Reviewers

  • wotjs020708
  • sum130
  • soseoyo12
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목 'Feat/#100 마이페이지 API 연결'은 변경 사항의 주요 내용인 마이페이지 API 연결을 명확하게 요약하고 있습니다.
Description check ✅ Passed PR 설명은 마이페이지 API 연결 작업에 관련되어 있으며, 구현 결과를 시각적으로 보여주는 GIF를 포함하고 있습니다.
Linked Issues check ✅ Passed 변경 사항들이 연결 이슈 #100의 목표인 마이페이지 API 연결을 완전히 구현하고 있습니다. 도메인 레이어, 데이터 레이어, 프레젠테이션 레이어 전반에 걸친 완전한 API 통합이 이루어졌습니다.
Out of Scope Changes check ✅ Passed 모든 변경 사항이 마이페이지 API 연결 구현과 직접적으로 관련되어 있으며, 범위를 벗어난 변경은 없습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat#100-마이페이지-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Fix all issues with AI agents
In `@Cherrish-iOS/Cherrish-iOS/Data/Model/UserInfoResponseDTO.swift`:
- Around line 10-18: The DTO currently risks decoding failures because API uses
snake_case keys; update UserInfoResponseDTO to explicitly map days_since_signup
to daysSinceSignup by adding a CodingKeys enum (case name, daysSinceSignup =
"days_since_signup") inside the struct so Decodable uses the correct key, and
keep the toEntity() conversion unchanged; alternatively ensure NetworkService's
JSONDecoder uses keyDecodingStrategy = .convertFromSnakeCase if you prefer a
global fix.

In `@Cherrish-iOS/Cherrish-iOS/Data/Repository/MyPageRepository.swift`:
- Around line 22-28: In fetchUserInfo(), stop defaulting userID to 1
(userDefaultService.load(key: .userID) ?? 1) because it can fetch another user's
data; instead validate the optional result from userDefaultService.load(key:
.userID) and if missing either throw a clear error (e.g., define and throw a
MissingUserID error) or propagate a failure to the caller before calling
MyPageAPI.users(userID:), ensuring the function does not proceed with a
hardcoded fallback.

In `@Cherrish-iOS/Cherrish-iOS/Domain/UseCase/FetchUserInfoUseCase.swift`:
- Around line 14-22: Rename the struct DefaultFetchUserInfoUserCase to
DefaultFetchUserInfoUseCase throughout the codebase and update all references
(including initializers, injections, protocol conformance to
FetchUserInfoUseCase, and any places that instantiate or type-annotate it) so
the identifier matches the corrected spelling; ensure the initializer
init(repository: MyPageInterface), the execute() async throws -> UserInfoEntity
method, and any tests or DI registrations are updated to the new name to avoid
compilation errors or mismatches.

In `@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageView.swift`:
- Around line 11-12: 현재 MyPageView에 외부에서 주입된 `@StateObject` var viewModel:
MyPageViewModel 사용은 부모가 인스턴스를 교체할 때 업데이트를 놓칠 수 있으니, 주입된 뷰모델이면 선언을
`@ObservedObject로` 변경하거나 뷰가 소유해야 할 경우에는 private `@StateObject로` 만들고 init(viewModel:
MyPageViewModel)에서 _viewModel = StateObject(wrappedValue: viewModel)로 명시적으로
초기화하여 소유권을 선언하십시오; 관련 심볼: MyPageView, MyPageViewModel, `@StateObject`,
`@ObservedObject`, init, _viewModel = StateObject(wrappedValue:).

In `@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageViewModel.swift`:
- Around line 10-23: The `@Published` properties name and day in MyPageViewModel
are being updated off the main thread inside fetchUserInfo(), so either mark the
view model class with `@MainActor` (e.g., `@MainActor` final class MyPageViewModel)
or ensure the assignments to name and day happen on the main actor by wrapping
them in await MainActor.run { ... } after calling
fetchUserInfoUseCase.execute(); update the implementation of fetchUserInfo()
accordingly to guarantee main-thread updates for the `@Published` properties.

In
`@Cherrish-iOS/Cherrish-iOS/Presentation/PresentationDependencyAssembler.swift`:
- Around line 60-66: The guard early-returns silently when
DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) yields nil, which
later leads to a fatalError in makeMyPageView(); update the guard to log an
error (using the same logger/mechanism used for other DI failures) that includes
the resolved type and context before returning so the DI failure is visible and
traceable; ensure the log references fetchUserInfoUseCase,
DIContainer.shared.resolve, MyPageViewModel and makeMyPageView() to make the
cause clear.

Comment on lines +10 to +18
struct UserInfoResponseDTO: Decodable {
let name: String
let daysSinceSignup: Int
}

extension UserInfoResponseDTO {
func toEntity() -> UserInfoEntity {
.init(name: name, daysSinceSignup: daysSinceSignup)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, find the file and examine its context
find . -name "UserInfoResponseDTO.swift" -type f

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 134


🏁 Script executed:

# Search for test files related to this DTO
find . -name "*UserInfo*" -type f | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 266


🏁 Script executed:

# Look for API response examples, mock data, or test fixtures
find . -type f \( -name "*.json" -o -name "*Mock*" -o -name "*Test*" \) | grep -i user | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Search for actual usage of UserInfoResponseDTO to understand the API response format
rg "UserInfoResponseDTO" -A 5 -B 5 --type swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 2597


🏁 Script executed:

# Look for any API documentation or response mapping
find . -name "*.swift" -type f | xargs rg -l "days_since_signup\|daysSinceSignup" | head -10

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Find MyPageAPI definition to understand the endpoint
rg "enum MyPageAPI\|case users" -A 10 --type swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Look for API documentation, OpenAPI specs, or response examples
find . -type f \( -name "*.md" -o -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) | xargs rg "days_since_signup\|daysSinceSignup" 2>/dev/null | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Check the network service implementation to understand how JSONDecoder is configured
rg "JSONDecoder\|keyDecodingStrategy" -B 3 -A 5 --type swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Look for any test files or fixtures that might have actual API responses
find . -type f -name "*Test*" -o -name "*Fixture*" -o -name "*Mock*" | xargs rg "name\|daysSinceSignup" 2>/dev/null | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# Check if there's API documentation or README
find . -name "README*" -o -name "API*" | xargs cat 2>/dev/null | grep -A 10 -B 2 -i "user\|response" | head -40

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 52


🏁 Script executed:

# List files in the data layer to understand structure
find ./Cherrish-iOS/Cherrish-iOS/Data -type f -name "*.swift" | head -20

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1194


🏁 Script executed:

# Find API definitions
find . -name "*API.swift" -o -name "*api.swift" | head -10

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 199


🏁 Script executed:

# Look at MyPageRepository more carefully
cat ./Cherrish-iOS/Cherrish-iOS/Data/Repository/MyPageRepository.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 877


🏁 Script executed:

# Search for any configuration or comments about API response format
rg "name|days|signup" -B 3 -A 3 --type swift | head -50

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 5072


🏁 Script executed:

# Check if there are any unit tests
find . -name "*Test*.swift" -o -name "*test.swift" | head -10

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 133


🏁 Script executed:

# Examine MyPageAPI.swift
cat ./Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/MyPageAPI.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 1039


🏁 Script executed:

# Examine NetworkService.swift
cat ./Cherrish-iOS/Cherrish-iOS/Data/Network/NetworkService.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 4441


🏁 Script executed:

# Check the single test file to see if there are response examples
cat ./Cherrish-iOS/Cherrish-iOS/Data/Network/EndPoint/TestAPI.swift

Repository: TEAM-Cherrish/Cherrish-iOS

Length of output: 269


API 응답 키 형식과의 매핑이 명시되지 않아 디코딩 실패 위험.

daysSinceSignup은 서버 응답이 snake_case 형식(예: days_since_signup)일 경우 디코딩에 실패합니다. NetworkService에서 JSONDecoder()를 기본 설정으로 사용하고 있어서 키명이 정확히 일치해야 하는데, 실제 API 응답 형식이 코드에 명시되지 않았습니다. CodingKeys를 추가하거나 keyDecodingStrategy를 설정하여 안전하게 처리해주세요.

수정안
 struct UserInfoResponseDTO: Decodable {
     let name: String
     let daysSinceSignup: Int
+
+    private enum CodingKeys: String, CodingKey {
+        case name
+        case daysSinceSignup = "days_since_signup"
+    }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
struct UserInfoResponseDTO: Decodable {
let name: String
let daysSinceSignup: Int
}
extension UserInfoResponseDTO {
func toEntity() -> UserInfoEntity {
.init(name: name, daysSinceSignup: daysSinceSignup)
}
struct UserInfoResponseDTO: Decodable {
let name: String
let daysSinceSignup: Int
private enum CodingKeys: String, CodingKey {
case name
case daysSinceSignup = "days_since_signup"
}
}
extension UserInfoResponseDTO {
func toEntity() -> UserInfoEntity {
.init(name: name, daysSinceSignup: daysSinceSignup)
}
}
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Data/Model/UserInfoResponseDTO.swift` around lines
10 - 18, The DTO currently risks decoding failures because API uses snake_case
keys; update UserInfoResponseDTO to explicitly map days_since_signup to
daysSinceSignup by adding a CodingKeys enum (case name, daysSinceSignup =
"days_since_signup") inside the struct so Decodable uses the correct key, and
keep the toEntity() conversion unchanged; alternatively ensure NetworkService's
JSONDecoder uses keyDecodingStrategy = .convertFromSnakeCase if you prefer a
global fix.

Comment on lines +22 to +28
func fetchUserInfo() async throws -> UserInfoEntity {
let userID: Int = userDefaultService.load(key: .userID) ?? 1
let response = try await networkService.request(
MyPageAPI.users(userID: userID),
decodingType: UserInfoResponseDTO.self)

return response.toEntity()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

userID 기본값 1은 타 사용자 정보 노출 위험.

Line 23에서 userID가 없을 때 1로 대체하면 다른 유저의 정보를 가져올 수 있습니다. 필수 값이 없으면 오류를 던지거나 상위로 처리하도록 변경하세요.

🔧 권장 수정안
 func fetchUserInfo() async throws -> UserInfoEntity {
-    let userID: Int = userDefaultService.load(key: .userID) ?? 1
+    guard let userID: Int = userDefaultService.load(key: .userID) else {
+        throw MyPageRepositoryError.missingUserID
+    }
     let response = try await networkService.request(
         MyPageAPI.users(userID: userID),
         decodingType: UserInfoResponseDTO.self)
     
     return response.toEntity()
 }
+
+enum MyPageRepositoryError: Error {
+    case missingUserID
+}
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Data/Repository/MyPageRepository.swift` around
lines 22 - 28, In fetchUserInfo(), stop defaulting userID to 1
(userDefaultService.load(key: .userID) ?? 1) because it can fetch another user's
data; instead validate the optional result from userDefaultService.load(key:
.userID) and if missing either throw a clear error (e.g., define and throw a
MissingUserID error) or propagate a failure to the caller before calling
MyPageAPI.users(userID:), ensuring the function does not proceed with a
hardcoded fallback.

Comment on lines +14 to +22
struct DefaultFetchUserInfoUserCase: FetchUserInfoUseCase {
private let repository: MyPageInterface

init(repository: MyPageInterface) {
self.repository = repository
}

func execute() async throws -> UserInfoEntity {
return try await repository.fetchUserInfo()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

타입명 오타(UserCase) 정리 권장.

Line 14의 DefaultFetchUserInfoUserCaseUseCase 오타로 보입니다. 추후 혼동을 줄이기 위해 DefaultFetchUserInfoUseCase로 정리하는 것을 권장합니다(관련 참조들도 함께 변경).

♻️ 권장 수정안
-struct DefaultFetchUserInfoUserCase: FetchUserInfoUseCase {
+struct DefaultFetchUserInfoUseCase: FetchUserInfoUseCase {
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Domain/UseCase/FetchUserInfoUseCase.swift` around
lines 14 - 22, Rename the struct DefaultFetchUserInfoUserCase to
DefaultFetchUserInfoUseCase throughout the codebase and update all references
(including initializers, injections, protocol conformance to
FetchUserInfoUseCase, and any places that instantiate or type-annotate it) so
the identifier matches the corrected spelling; ensure the initializer
init(repository: MyPageInterface), the execute() async throws -> UserInfoEntity
method, and any tests or DI registrations are updated to the new name to avoid
compilation errors or mismatches.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요고 확인 부탁드릴게욤

Comment on lines +11 to +12
@StateObject var viewModel: MyPageViewModel

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

주입된 뷰모델은 @ObservedObject(또는 명시적 StateObject 초기화) 권장.

Line 11-12의 @StateObject는 외부에서 주입된 인스턴스를 부모가 교체할 때 업데이트가 무시될 수 있습니다. 주입된 객체라면 @ObservedObject로 바꾸거나, init에서 _viewModel = StateObject(wrappedValue:)로 명시적으로 소유권을 선언하는 쪽이 안전합니다.

♻️ 권장 수정안
-    `@StateObject` var viewModel: MyPageViewModel
+    `@ObservedObject` var viewModel: MyPageViewModel

또는

`@StateObject` private var viewModel: MyPageViewModel
init(viewModel: MyPageViewModel) {
    _viewModel = StateObject(wrappedValue: viewModel)
}
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Presentation/Feature/MyPage/MyPageView.swift`
around lines 11 - 12, 현재 MyPageView에 외부에서 주입된 `@StateObject` var viewModel:
MyPageViewModel 사용은 부모가 인스턴스를 교체할 때 업데이트를 놓칠 수 있으니, 주입된 뷰모델이면 선언을
`@ObservedObject로` 변경하거나 뷰가 소유해야 할 경우에는 private `@StateObject로` 만들고 init(viewModel:
MyPageViewModel)에서 _viewModel = StateObject(wrappedValue: viewModel)로 명시적으로
초기화하여 소유권을 선언하십시오; 관련 심볼: MyPageView, MyPageViewModel, `@StateObject`,
`@ObservedObject`, init, _viewModel = StateObject(wrappedValue:).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 방법이 맞는 거 같기는 한데 한번 확인 부탁드려요!

Comment on lines +60 to +66
guard let fetchUserInfoUseCase = DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) else {
return
}

DIContainer.shared.register(type: MyPageViewModel.self) {
return MyPageViewModel(fetchUserInfoUseCase: fetchUserInfoUseCase)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

DI 실패 로그 누락으로 원인 추적이 어려움

fetchUserInfoUseCase가 nil일 때 조용히 반환해 이후 makeMyPageView()에서 fatalError로 이어질 수 있습니다. 다른 DI 실패와 동일하게 로그를 남겨 원인 파악 가능하게 해주세요.

🛠️ 제안 수정안
-        guard let fetchUserInfoUseCase = DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) else {
-            return
-        }
+        guard let fetchUserInfoUseCase = DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) else {
+            CherrishLogger.error(CherrishError.DIFailedError)
+            return
+        }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
guard let fetchUserInfoUseCase = DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) else {
return
}
DIContainer.shared.register(type: MyPageViewModel.self) {
return MyPageViewModel(fetchUserInfoUseCase: fetchUserInfoUseCase)
}
guard let fetchUserInfoUseCase = DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) else {
CherrishLogger.error(CherrishError.DIFailedError)
return
}
DIContainer.shared.register(type: MyPageViewModel.self) {
return MyPageViewModel(fetchUserInfoUseCase: fetchUserInfoUseCase)
}
🤖 Prompt for AI Agents
In `@Cherrish-iOS/Cherrish-iOS/Presentation/PresentationDependencyAssembler.swift`
around lines 60 - 66, The guard early-returns silently when
DIContainer.shared.resolve(type: FetchUserInfoUseCase.self) yields nil, which
later leads to a fatalError in makeMyPageView(); update the guard to log an
error (using the same logger/mechanism used for other DI failures) that includes
the resolved type and context before returning so the DI failure is visible and
traceable; ensure the log references fetchUserInfoUseCase,
DIContainer.shared.resolve, MyPageViewModel and makeMyPageView() to make the
cause clear.

Copy link
Contributor

@wotjs020708 wotjs020708 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!
KakaoTalk_Photo_2026-01-09-22-59-49 004

Comment on lines +14 to +22
struct DefaultFetchUserInfoUserCase: FetchUserInfoUseCase {
private let repository: MyPageInterface

init(repository: MyPageInterface) {
self.repository = repository
}

func execute() async throws -> UserInfoEntity {
return try await repository.fetchUserInfo()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요고 확인 부탁드릴게욤

Comment on lines +11 to +12
@StateObject var viewModel: MyPageViewModel

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요 방법이 맞는 거 같기는 한데 한번 확인 부탁드려요!

Copy link
Contributor

@sum130 sum130 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿입니다용 재선이가 리뷰남긴 것들!! 저도 눈 이모지 남겨놨어요 함 확인해주세용

@y-eonee y-eonee force-pushed the feat#100-마이페이지-api branch from c3e0cb8 to 366c107 Compare January 20, 2026 21:08
Copy link
Contributor

@soseoyo12 soseoyo12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다

@y-eonee y-eonee merged commit a399436 into develop Jan 20, 2026
1 check was pending
@y-eonee y-eonee deleted the feat#100-마이페이지-api branch January 20, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature 새로운 기능 구현 및 API 연결 나연🐹

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 마이페이지 API 연결

4 participants