Skip to content

[Feat] Hilt 세팅#12

Merged
ckals413 merged 4 commits intodevelopfrom
feat/#4-hilt
Jan 10, 2026
Merged

[Feat] Hilt 세팅#12
ckals413 merged 4 commits intodevelopfrom
feat/#4-hilt

Conversation

@ckals413
Copy link
Contributor

@ckals413 ckals413 commented Jan 6, 2026

📮 관련 이슈

📌 작업 내용

  • Hilt초기세팅
  • NetworkModule 구현 완료
  • @HiltAndroidApp 추가
  • @androidentrypoint 추가
  • Repository에 @Inject constructor 추가
  • Hilt 코드 자동 생성 확인

🫛 To. 리뷰어

Hilt 세팅을 처음 해보는데,

  • Json 설정에 추가로 필요한 옵션이나 지금 틀린게 있는지,
  • FlintApi 인터페이스 구현체 생성을 NetworkModule에서 하는게 맞는지,
  • 추가로 필요한 파일이 있는지
    봐주시면 감사하겠습니다!

@ckals413 ckals413 self-assigned this Jan 6, 2026
@ckals413 ckals413 added ⚙️ Setting feat - 기본 세팅 Feat ✨ 신규 기능을 추가하거나 기존 기능의 동작, 정책을 변경 labels Jan 6, 2026
@ckals413 ckals413 linked an issue Jan 6, 2026 that may be closed by this pull request
1 task
@ckals413 ckals413 changed the title feat: Hilt세팅 [Feat] Hilt 세팅 Jan 6, 2026
Copy link
Contributor

@kimjw2003 kimjw2003 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 리뷰한것만 적용해주시고 나중에 ViewModel 생기면 @hiltviewmodel 꼭 넣기!


@Provides
@Singleton
fun provideFlintApi(retrofit: Retrofit): FlintApi =
Copy link
Contributor

Choose a reason for hiding this comment

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

p1
해당 내용은 ApiModule이라는 싱글톤 object 파일에다가 넣어주시면 어떨까요?
FlintApi 뿐만 아니라 다른 Api도 사용할수 있으니까

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정했습니다±!

Copy link
Contributor

@nahy-512 nahy-512 left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니당ㅎㅎ
작업 너무 잘 해주셨는데, 이번 설정에서 미리 추가해주시면 좋겠는 내용들이 있어서 리젝드립니당

Comment on lines +27 to +29
} else {
HttpLoggingInterceptor.Level.NONE
}
Copy link
Contributor

Choose a reason for hiding this comment

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

p1
저희 그 FlintApplication에서 timber로 디버그만 로그 설정을 해둬서, 이 부분 빼도 크게 상관없을 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

p1
ServiceModule도 필요할 것 같아요!
FlintApiretrofit.create 설정해줄 용도로

Copy link
Contributor

Choose a reason for hiding this comment

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

p1.5)
MVVM 구조까지 원래 제가 설정해보려 했었는데ㅎㅎ
예시용으로 차민님 파트인 onboarding으로 presentation 안에 폴더 하나 만들고, OnboardingScreen이랑 OnboardingViewModel도 한번 만들고, @inject 예시 넣어보면 좋을 것 같아요!

Copy link
Contributor

@nahy-512 nahy-512 left a comment

Choose a reason for hiding this comment

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

확인 완!! 고생하셨습니다~~

Copy link
Contributor

@kimjw2003 kimjw2003 left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@giovannijunseokim giovannijunseokim left a comment

Choose a reason for hiding this comment

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

Hilt 세팅 고생 많으셨습니다! 👍

코드를 보며 궁금한 점들을 리뷰로 남겨보았습니다.

답변 후 다시 리뷰 요청 부탁드립니다. 🙇

Comment on lines +43 to +45
connectTimeout(20, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
Copy link
Contributor

Choose a reason for hiding this comment

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

p2: 이 부분은 어떤 의도로 설정된 것일까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네트워크 불안정 상황 대비, 이미지/파일 업로드 고려해서 두었습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

최대 20초까지 로딩 뷰를 보여줄 수도 있다는 건데, 이 때 사용자가 20초를 기다려야 하는 점이 우려되네요.

이 부분은 서버 팀과 협의가 필요하지 않을까요? 서버 개발자분들께서 API의 평균 응답 시간이나 최대 허용 시간 등을 알 수도 있으니까요.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hilt 세팅이 너무 늦어지는 것 같다면 해당 내용 별도 이슈로 빼신 후 작업하시는 것도 좋을 것 같습니다. 🙂

Comment on lines +51 to +58
fun provideRetrofit(
okHttpClient: OkHttpClient,
json: Json
): Retrofit = Retrofit.Builder()
.baseUrl(BuildConfig.BASE_URL)
.client(okHttpClient)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.build()
Copy link
Contributor

Choose a reason for hiding this comment

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

p2: 사실상 이 함수 내에서 HttpLoggingInterceptor, OkHttpClient, Json을 전부 생성해줘도 되지 않나요?

어떤 기준으로 함수를 분리한 것인지 궁금합니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

재사용성과 단일책임원칙을 위해서 함수를 분리했습니다. 향후확장성도 고려해

Copy link
Contributor

Choose a reason for hiding this comment

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

재사용에 관해서는 현재 재사용 되고있지 않은데, 추후 어떤 상황에 재사용할 일이 생길까요?

함수가 짧게 유지되면서 한 가지 일만 하도록 만들어져 가독성 측에서는 좋은 것 같습니다. 👍


@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {
Copy link
Contributor

Choose a reason for hiding this comment

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

p2: Api들을 제공하는 모듈인 것 같아요.
ServiceModule이라는 네이밍이 필요할까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FlintApi랑 retrofit.create 설정해줄 용도로 만들었는데 어떤 네이밍이 적절할까요?

Copy link
Contributor

Choose a reason for hiding this comment

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

네이밍은 항상 어렵죠. 저라면 NetworkModule 내부에 두거나, ApiModule이라는 이름을 사용할 것 같아요.

그 외의 파일에서는 어떻게 네이밍했는지 확인해보겠습니다.

  • Network 작업을 위해 필요한 객체들을 NetworkModule에서 제공하고
  • Repository들을 RepositoryModule에서 주고 있어요.

ServiceModule라는 이름을 사용하기엔

  • Service가 무엇인지 구체적으로 정의되지 않은 것 같고
  • 실제로 Service 객체를 제공하고 있지도 않아요.

때문에 어색한 이름이라는 인상을 받았습니다.

@ckals413 ckals413 requested a review from a team as a code owner January 10, 2026 05:44
@ckals413
Copy link
Contributor Author

좋은 의견 감사합니다!

확인해보니 HttpLoggingInterceptor는 내부적으로 android.util.Log
직접 사용하기 때문에, FlintApplication의 Timber 설정과 무관하게 작동하는 것 같고,RELEASE 빌드에서도 HTTP Body가 로그에 남아
보안 문제가 될 수 있어서 else NONE 설정을 다시 추가했습니다!

Copy link
Contributor

@giovannijunseokim giovannijunseokim left a comment

Choose a reason for hiding this comment

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

추가 코멘트 남겼으니 확인 후 머지해주시면 좋을 것 같습니다. 🙂

추가적으로 각 리뷰를 반영했다면 해당 내용이 담긴 커밋을 답변에 남겨주시면 확인이 편할 것 같아요. 리뷰마다 커밋이 나눠진다면 더욱 좋을 것 같구요. 👍

이 부분은 앱잼을 진행하며 조바심 갖지 않으셔도 됩니다. Hilt 세팅 고생하셨습니다. 🔥

Comment on lines +43 to +45
connectTimeout(20, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
Copy link
Contributor

Choose a reason for hiding this comment

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

최대 20초까지 로딩 뷰를 보여줄 수도 있다는 건데, 이 때 사용자가 20초를 기다려야 하는 점이 우려되네요.

이 부분은 서버 팀과 협의가 필요하지 않을까요? 서버 개발자분들께서 API의 평균 응답 시간이나 최대 허용 시간 등을 알 수도 있으니까요.

Comment on lines +43 to +45
connectTimeout(20, TimeUnit.SECONDS)
writeTimeout(20, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hilt 세팅이 너무 늦어지는 것 같다면 해당 내용 별도 이슈로 빼신 후 작업하시는 것도 좋을 것 같습니다. 🙂

Comment on lines +51 to +58
fun provideRetrofit(
okHttpClient: OkHttpClient,
json: Json
): Retrofit = Retrofit.Builder()
.baseUrl(BuildConfig.BASE_URL)
.client(okHttpClient)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.build()
Copy link
Contributor

Choose a reason for hiding this comment

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

재사용에 관해서는 현재 재사용 되고있지 않은데, 추후 어떤 상황에 재사용할 일이 생길까요?

함수가 짧게 유지되면서 한 가지 일만 하도록 만들어져 가독성 측에서는 좋은 것 같습니다. 👍


@Module
@InstallIn(SingletonComponent::class)
object ServiceModule {
Copy link
Contributor

Choose a reason for hiding this comment

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

네이밍은 항상 어렵죠. 저라면 NetworkModule 내부에 두거나, ApiModule이라는 이름을 사용할 것 같아요.

그 외의 파일에서는 어떻게 네이밍했는지 확인해보겠습니다.

  • Network 작업을 위해 필요한 객체들을 NetworkModule에서 제공하고
  • Repository들을 RepositoryModule에서 주고 있어요.

ServiceModule라는 이름을 사용하기엔

  • Service가 무엇인지 구체적으로 정의되지 않은 것 같고
  • 실제로 Service 객체를 제공하고 있지도 않아요.

때문에 어색한 이름이라는 인상을 받았습니다.

@ckals413 ckals413 merged commit 03ec02d into develop Jan 10, 2026
1 check passed
@kimjw2003 kimjw2003 deleted the feat/#4-hilt branch January 12, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feat ✨ 신규 기능을 추가하거나 기존 기능의 동작, 정책을 변경 ⚙️ Setting feat - 기본 세팅

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] Hilt 세팅

4 participants