Skip to content

feat: 6주차 미션_레몬#44

Open
Lemon0610 wants to merge 4 commits into
mainfrom
lemon-6
Open

feat: 6주차 미션_레몬#44
Lemon0610 wants to merge 4 commits into
mainfrom
lemon-6

Conversation

@Lemon0610
Copy link
Copy Markdown
Collaborator

@Lemon0610 Lemon0610 commented May 6, 2026

📌 PR 제목

🔗 관련 이슈

Closes #43

✨ 변경 사항

-Hilt 설정
-Repository 생성
-ViewModel 생성
-Fragment와 ViewModel 연결

🔍 테스트

  • 테스트 완료
  • 에러 없음

📸 스크린샷 (선택)

정상 작동되는 화면 1 정상 작동되는 화면 2
화면 캡처 2026-05-06 125635 화면 캡처 2026-05-06 125618

🚨 추가 이슈

@Lemon0610 Lemon0610 changed the title feat:6주차 미션_레몬 feat: 6주차 미션_레몬 May 6, 2026
@Lemon0610 Lemon0610 self-assigned this May 6, 2026
Comment thread Week3/build.gradle.kts
@@ -0,0 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.2" apply false
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

제가 고생했던 부분이네요! 버전을 낮추는 걸 몰라서 엄청 고생했습니다

Copy link
Copy Markdown
Collaborator

@jeongkyueun jeongkyueun left a comment

Choose a reason for hiding this comment

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

폴더 구조를 조금만 다듬어서 정리하면 보기 편할 거 같아요 !! 과제 모두 잘 수행하셨습니다!!

Comment thread Week3/build.gradle.kts
Comment on lines +4 to +7
id("com.android.library") version "8.2.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
id("com.google.dagger.hilt.android") version "2.48.1" apply false
} No newline at end of file
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

gradle 맞추느라 너무 수고하셨어요... 멋져요

Copy link
Copy Markdown
Collaborator

@kimdoyeon1234 kimdoyeon1234 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다! 🍋ㅎㅎ

이번 코드는 @HiltAndroidApp, @androidentrypoint, @hiltviewmodel 어노테이션을
모두 정확하게 적용하셨고, NetworkModule과 LocalModule을 분리하고
RemoteRepository/LocalRepository로 역할을 나눈 점, 그리고 ProductAdapter에 DiffUtil을 활용한 점이 정말 좋았어요!

다만 이번 미션의 핵심은 패키지 분리입니다!
현재 MainActivity, Fragment, Repository, Model 등 모든 파일이 루트 패키지(com.example.week3)에 몰려있는데,
data/model/, data/repository/, domain/repository/, di/, ui/home/, ui/profile/ 처럼
역할에 맞게 패키지를 나눠주세요 !

또한 MainViewModel 하나가 프로필, 팔로잉, 상품, 위시리스트를 모두 담당하고 있는데,
화면별로 HomeViewModel, ProfileViewModel, PurchaseShoesViewModel, WishlistViewModel로 분리하고, WishlistFragment의 위시리스트 필터링 로직처럼 Fragment에 있는 비즈니스 로직은 ViewModel로 옮겨주시면 더욱 완성도 있는 코드가 될 것 같아요!

전반적으로 Hilt 적용 자체는 완벽하게 하셨으니 패키지 구조와 ViewModel 분리만
다듬어주시면 훨씬 좋아질 것 같습니다. 고생 많으셨어요!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

MainViewModel 하나가 프로필, 팔로잉, 상품, 위시리스트를 모두 처리하고 있어요! 화면별로 HomeViewModel, ProfileViewModel, PurchaseShoesViewModel, WishlistViewModel로 분리 하는게 좋을거 같습니다!

Comment on lines +16 to +17
private val viewModel: MainViewModel by viewModels()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

MainViewModel을 공유하지 않고 HomeFragment 전용 HomeViewModel을 만들어서 사용해보는게 좋을거 같습니다! 현재는 불필요한 프로필/팔로잉 데이터까지 들고 있게 됩니다..

Comment on lines +31 to +34
viewModel.productList.observe(viewLifecycleOwner) { allProducts ->
val wishList = allProducts.filter { it.isWished }
productAdapter.submitList(wishList)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

위시리스트 필터링 로직이 Fragment에 있어요! 이런 비즈니스 로직은 ViewModel 안으로 옮겨주세요 :)

Comment on lines +26 to +30
viewModel.userProfile.observe(viewLifecycleOwner) { user ->
tvNickname.text = "${user.firstName} ${user.lastName}"
Glide.with(this).load(user.avatar).into(imgProfile)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"${user.firstName} ${user.lastName}" 같은 문자열 조합은 UI 로직이라 Fragment에 있어도 괜찮지만, Glide 이미지 로딩은 BindingAdapter로 분리하면 더 깔끔해요!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이번 미션의 핵심은 패키지 분리입니다! LocalRepository → data/repository/ 패키지를 만들어서 이동시켜주세요 :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

RemoteRepository도 data/repository/ 패키지로 이동시켜주세요! 추가로 domain/repository/에 interface를 만들고,
data/repository/에 구현체를 두는 구조로 분리하면 더 좋습니다!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

모델 클래스들은 data/model/ 패키지로 이동시켜주세요!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

모델 클래스들은 data/model/ 패키지로 이동시켜주세요!

Comment on lines +24 to +27
Glide.with(holder.itemView.context)
.load(user.avatar)
.into(holder.image)
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

이것도 이미지 로딩을 ProfileBindingAdapters.kt처럼 BindingAdapter로 분리하면 더 좋을거 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 6주차 미션_레몬

5 participants