Skip to content
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

[init] 프로젝트 기초 세팅 #2

Merged
merged 46 commits into from
Jul 2, 2024
Merged

Conversation

jihyunniiii
Copy link
Contributor

@jihyunniiii jihyunniiii commented Jun 25, 2024

Related issue 🛠

Work Description ✏️

  • 프로젝트 기초 세팅을 완료하였습니다.
    -> 지난 1차 회의에서 정했던 대로 Koala 2024.1.1 로 초기세팅 진행하였고, Compose + MVI + 클린 아키텍처를 사용해 dummy 파일 넣어두었습니다!
    -> GitHub 세팅과, Firebase Crashlytics, Sentry 설정 + 슬랙 연동 모두 진행하였습니다.

Screenshot 📸

Screen_recording_20240627_165915.mp4

Uncompleted Tasks 😅

  • CI/CD

To Reviewers 📢

  • 지난주에 이론 공부했던 내용을 기반으로 dummy 파일들을 보면서 이런 식으로 적용하면 되는구나를 익히면 좋을 것 같아요! (모르는 거 있으면 언제든 코드 리뷰 해주세용)
  • CI/CD도 오늘 안에 끝내도록 하겠습니다
  • Sentry와 Firebase Crashlytics를 활용해서 이슈 대응이 가능하도록 하였습니다. 두 개 다 슬랙 연동 해놓아서 프로젝트에 따로 추가는 안 해두었는데 필요하면 말씀해 주세요.
  • google-service.json, local.properties, sentry.properties 파일은 슬랙으로 전달 드릴 예정입니다!

@jihyunniiii jihyunniiii requested a review from a team June 27, 2024 08:07
Copy link
Member

@2hyunjinn 2hyunjinn 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
Member

Choose a reason for hiding this comment

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

그녀는 정말 야무지다.. 무려 템플릿까지...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

우하하

}

private fun setDarkMode() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
Copy link
Member

Choose a reason for hiding this comment

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

MODE_NIGHT_NO 이게 다크모드 설정 안한다는 뜻 맞나요?!

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
Member

Choose a reason for hiding this comment

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

이건 어디서 어떻게 쓰는 건가여,,?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

상단 파일인 DummyService 파일을 보시면 URL, Query 값 등이 상수화 처리 되어있는데요. 해당 부분을 상수화 할 때 사용합니다. 해당 endPoint 들은 서버 측에서 한 번에 변경시키는 경우가 많다고 생각해서 상수화 처리를 해두었습니다! 해당 파일에서만 변경하면 모든 파일에서 변경 되게끔 하려구요

override fun contentType(): MediaType? =
contentResolver.getType(uri)?.toMediaTypeOrNull()

override fun writeTo(sink: BufferedSink) {
Copy link
Member

Choose a reason for hiding this comment

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

이건 어디에 쓰는 건가요!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

멀티파트를 통해 이미지를 서버로 업로드 할 때 사용되는 파일이에요. 해당 함수는 RequestBody (ContentUriRequestBody가 상속받고 있는,,)를 통해 오버라이딩 되는 함수인데요. 특정 Uri로부터 값을 읽어서 BufferedSink 파일에 작성하는 일을 합니다. 즉, 해당 함수는 사용자로부터 받아온 URI를 네트워크로 전송이 가능하도록 만드는 역할을 해요.

@InstallIn(SingletonComponent::class)
object ContentResolverModule {
@Provides
@Singleton
Copy link
Member

Choose a reason for hiding this comment

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

싱글톤,,, 공부하러 갈게요,,,

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
Member

@2hyunjinn 2hyunjinn 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
Member

Choose a reason for hiding this comment

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

너 진짜 멋있다 ㅠㅠ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

엥 별거 없서요 ㅠㅠ

import org.sopt.dateroad.domain.repository.UserInfoRepository

@Singleton
class ClearUserInfoUseCase @Inject constructor(
Copy link
Member

Choose a reason for hiding this comment

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

이 유즈케이스는 어떤 뷰에서 사용하는 건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아마 추후 로그아웃이나 회원탈퇴할 때 사용될 거라 마이페이지 뷰에서 사용될 것 같습니다 ! (유저가 탈퇴나 로그아웃을 하면 sharedPreferences에 저장된 값들을 전부 날려야 하므로 해당 경우에 사용)

Copy link
Member

@t1nm1ksun t1nm1ksun 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
Member

Choose a reason for hiding this comment

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

근데 제가 학교 프로젝트 하다가 봤는데 이렇게 오는 response들은 안 받을 수도 있는거에요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

넹 형태가 다르다면 BaseResponse 사용하지 않아도 됩니다! 필요한 경우에만 사용해 주세요

}

override var isLogin: Boolean
get() = sharedPreferences.getBoolean(IS_LOGIN, false)
Copy link
Member

Choose a reason for hiding this comment

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

로그인, 로그아웃에서 값 바꿔주거나 하단 네비바 visible바꿔줄 때 여기 구현체에 접근 하면 되는건가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

로컬에서 관리할 값들을 저장해 줍니다! 보통 AccessToken, RefreshToken 등을 넣어놔요. 여기서는 자동 로그인을 구현하기 위한 자동 로그인 값들 미리 저장해 두었습니다 ~ 추후 설계 단계에서 어떤 것들을 넣을지 같이 정해보면 좋을 것 같네요! 근데 아마 지금 기능에서는 토큰이랑 자동 로그인 정보만 저장해 놓으면 될 것 같아오

Copy link
Contributor Author

Choose a reason for hiding this comment

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

흠,, 추가적으로 저장하고 싶은 것들이 있긴 한데 이건 추후 논의해 보도록 합시당

Comment on lines +23 to +28
@Multipart
@POST("$API")
suspend fun postDummyMultipart(
@Part image: MultipartBody.Part,
@Part("$CONTENT") content: RequestBody
): BaseResponse<Unit>
Copy link
Member

Choose a reason for hiding this comment

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

엄마가 보라했던 블로그에서 본 형태!

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 Author

@jihyunniiii jihyunniiii left a comment

Choose a reason for hiding this comment

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

PR 확인 감사합니당

Copy link
Contributor Author

Choose a reason for hiding this comment

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

우하하

}

private fun setDarkMode() {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
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 Author

Choose a reason for hiding this comment

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

상단 파일인 DummyService 파일을 보시면 URL, Query 값 등이 상수화 처리 되어있는데요. 해당 부분을 상수화 할 때 사용합니다. 해당 endPoint 들은 서버 측에서 한 번에 변경시키는 경우가 많다고 생각해서 상수화 처리를 해두었습니다! 해당 파일에서만 변경하면 모든 파일에서 변경 되게끔 하려구요

}

override var isLogin: Boolean
get() = sharedPreferences.getBoolean(IS_LOGIN, false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

로컬에서 관리할 값들을 저장해 줍니다! 보통 AccessToken, RefreshToken 등을 넣어놔요. 여기서는 자동 로그인을 구현하기 위한 자동 로그인 값들 미리 저장해 두었습니다 ~ 추후 설계 단계에서 어떤 것들을 넣을지 같이 정해보면 좋을 것 같네요! 근데 아마 지금 기능에서는 토큰이랑 자동 로그인 정보만 저장해 놓으면 될 것 같아오

}

override var isLogin: Boolean
get() = sharedPreferences.getBoolean(IS_LOGIN, false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

흠,, 추가적으로 저장하고 싶은 것들이 있긴 한데 이건 추후 논의해 보도록 합시당

@InstallIn(SingletonComponent::class)
object ContentResolverModule {
@Provides
@Singleton
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 Author

Choose a reason for hiding this comment

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

엥 별거 없서요 ㅠㅠ

import org.sopt.dateroad.domain.repository.UserInfoRepository

@Singleton
class ClearUserInfoUseCase @Inject constructor(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

아마 추후 로그아웃이나 회원탈퇴할 때 사용될 거라 마이페이지 뷰에서 사용될 것 같습니다 ! (유저가 탈퇴나 로그아웃을 하면 sharedPreferences에 저장된 값들을 전부 날려야 하므로 해당 경우에 사용)

@jihyunniiii jihyunniiii merged commit 91db547 into develop Jul 2, 2024
1 check passed
@jihyunniiii jihyunniiii deleted the init-project-setting branch July 2, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[init] 프로젝트 기초 세팅
3 participants