Skip to content

πŸ”€ :: (#48)- User μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€#50

Merged
kimjeakwan merged 30 commits intodevelopfrom
feature/48-UserApi
Jan 24, 2025
Merged

πŸ”€ :: (#48)- User μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€#50
kimjeakwan merged 30 commits intodevelopfrom
feature/48-UserApi

Conversation

@kimjeakwan
Copy link
Collaborator

@kimjeakwan kimjeakwan commented Jan 23, 2025

πŸ’‘ κ°œμš”

  • User μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ UserAPI, UserRepository, UserDatasource, UserVIewModel 을 μž‘μ—…ν–ˆμŠ΅λ‹ˆλ‹€.

πŸ“ƒ μž‘μ—…λ‚΄μš©

  • User μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ UserAPI, UserRepository, UserDatasource, UserVIewModel , UserResponse, UserResponseModel, UserRepositoryImpl, UserDatasourceImpl, 을 μΆ”κ°€ν•˜μ—¬ μ„œλ²„ν†΅μ‹ μ„ μœ„ν•œ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€

πŸ”€ 변경사항

UserAPI,
UserRepository,
UserDatasource,
UserVIewModel ,
UserResponse,
UserResponseModel,
UserRepositoryImpl,
UserDatasourceImpl

πŸ™‹β€β™‚οΈ μ§ˆλ¬Έμ‚¬ν•­

  • κ°œμ„ ν•  점, μ˜€νƒ€, μ½”λ“œμ— μ΄μ‚°ν•œ 뢀뢄이 μžˆλ‹€λ©΄ Comment λ‹¬μ•„μ£Όμ„Έμš”.

🍴 μ‚¬μš©λ°©λ²•

🎸 기타

Summary by CodeRabbit

릴리즈 λ…ΈνŠΈ

  • μƒˆλ‘œμš΄ κΈ°λŠ₯

    • μ‚¬μš©μž 데이터 검색 및 ν”„λ‘œν•„ 쑰회 κΈ°λŠ₯ μΆ”κ°€
    • μ‚¬μš©μž λž­ν‚Ή 및 포인트 μ‹œμŠ€ν…œ ν™•μž₯
    • μ‚¬μš©μž μƒνƒœ 관리λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ UI μƒνƒœ λͺ¨λΈ μΆ”κ°€
    • μ‚¬μš©μž 데이터 μ†ŒμŠ€λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ μΈν„°νŽ˜μ΄μŠ€ 및 κ΅¬ν˜„ μΆ”κ°€
    • μ‚¬μš©μž 응닡 데이터λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ 데이터 클래슀 및 λ³€ν™˜ κΈ°λŠ₯ μΆ”κ°€
    • κ²°κ³Ό μƒνƒœλ₯Ό λ‚˜νƒ€λ‚΄λŠ” μƒˆλ‘œμš΄ μ‹œκ·Έλ‹ˆμ²˜ μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€
    • μ‚¬μš©μž κ΄€λ ¨ 데이터 처리λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ 리포지토리 및 μœ μŠ€μΌ€μ΄μŠ€ μΆ”κ°€
  • κ°œμ„  사항

    • μ‚¬μš©μž 데이터 처리λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ μ•„ν‚€ν…μ²˜ μ»΄ν¬λ„ŒνŠΈ λ„μž…
    • UI μƒνƒœ 관리λ₯Ό μœ„ν•œ κ°œμ„ λœ μƒνƒœ λͺ¨λΈ κ΅¬ν˜„
  • 기술적 λ³€κ²½

    • λ°˜μ‘ν˜• 데이터 흐름 및 코루틴 기반 비동기 처리 μΆ”κ°€
    • μ˜μ‘΄μ„± μ£Όμž… 및 λͺ¨λ“ˆ ꡬ쑰 μ΅œμ ν™”
    • μ‚¬μš©μž κ΄€λ ¨ 데이터 λͺ¨λΈ 및 응닡 처리 κ°œμ„ 
    • κΈ°μ‘΄ 데이터 λͺ¨λΈμ˜ 속성 이름 λ³€κ²½ 및 μ—…λ°μ΄νŠΈ
    • Gradle μ„€μ • 및 λΉŒλ“œ ꡬ성 파일 κ°œμ„ 

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2025

"""

Walkthrough

이 ν’€ λ¦¬ν€˜μŠ€νŠΈλŠ” μ‚¬μš©μž 데이터 관리λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ κΈ°λŠ₯을 μΆ”κ°€ν•©λ‹ˆλ‹€. μ£Όμš” λ³€κ²½ 사항은 μ‚¬μš©μž API, 데이터 μ†ŒμŠ€, 리포지토리, λ·° λͺ¨λΈμ„ ν¬ν•¨ν•˜λŠ” μ‚¬μš©μž κ΄€λ ¨ ꡬ성 μš”μ†Œμ˜ 전체 μŠ€νƒμ„ λ„μž…ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€. μ΄λŠ” μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ— μ‚¬μš©μž 정보 검색 및 처리λ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ μ•„ν‚€ν…μ²˜ λ ˆμ΄μ–΄λ₯Ό κ΅¬ν˜„ν•©λ‹ˆλ‹€.

Changes

파일 λ³€κ²½ μš”μ•½
.idea/other.xml μƒˆ OPPO, μ‚Όμ„±, λͺ¨ν† λ‘œλΌ κΈ°κΈ° ν•­λͺ© μΆ”κ°€
app/src/main/java/module/NetworkModule.kt provideUserAPi λ©”μ„œλ“œ μΆ”κ°€
app/src/main/java/module/RemoteDataSourceModule.kt provideUsersDatasource λ©”μ„œλ“œ μΆ”κ°€
app/src/main/java/module/RepositoryModule.kt providerUsersRepository λ©”μ„œλ“œ μΆ”κ°€
data/src/main/java/remote/api/auth/UsersAPi.kt μƒˆ μ‚¬μš©μž API μΈν„°νŽ˜μ΄μŠ€ 생성
data/src/main/java/remote/datasource/users/UsersDataSource.kt μ‚¬μš©μž 데이터 μ†ŒμŠ€ μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€
data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt μ‚¬μš©μž 데이터 μ†ŒμŠ€ κ΅¬ν˜„ 클래슀 μΆ”κ°€
data/src/main/java/remote/dto/users/response/UsersResponse.kt μ‚¬μš©μž 응닡 데이터 클래슀 생성
data/src/main/java/repoistory/UsersRepositoryImpl.kt μ‚¬μš©μž 리포지토리 κ΅¬ν˜„ μΆ”κ°€
domain/src/main/java/model/users/response/UsersResponseModel.kt μ‚¬μš©μž 응닡 λͺ¨λΈ 생성
domain/src/main/java/reopoistory/UsersRepository.kt μ‚¬μš©μž 리포지토리 μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€
domain/src/main/java/usecase/Users/GetUsersUseCase.kt μ‚¬μš©μž 데이터 κ°€μ Έμ˜€κΈ° μœ μŠ€μΌ€μ΄μŠ€ μΆ”κ°€
presentation/src/main/java/viewModel/UIstate/UsersUiState.kt μ‚¬μš©μž UI μƒνƒœ μΈν„°νŽ˜μ΄μŠ€ 생성
presentation/src/main/java/viewModel/users/UsersViewModel.kt μ‚¬μš©μž λ·° λͺ¨λΈ μΆ”κ°€
presentation/src/main/java/view/Mypage/Screen/MyPage.kt 데이터 λͺ¨λΈμ„ UsersResponseModel둜 λ³€κ²½

Poem

🐰 μ½”λ“œμ˜ 토끼, μ‚¬μš©μžλ₯Ό μ°Ύμ•„μ„œ
λ°μ΄ν„°μ˜ μˆ²μ„ 깑총깑총
API와 λͺ¨λΈμ΄ 좀을 μΆ”λ„€
λ·°λͺ¨λΈμ€ μƒνƒœλ₯Ό λ…Έλž˜ν•˜κ³ 
μƒˆλ‘œμš΄ κΈ°λŠ₯, 반짝반짝! 🌟
"""


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8911cdf and 14ecf7b.

πŸ“’ Files selected for processing (4)
  • data/src/main/java/remote/datasource/users/UsersDataSource.kt (1 hunks)
  • data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt (1 hunks)
  • data/src/main/java/remote/dto/users/response/UsersResponse.kt (1 hunks)
  • presentation/src/main/java/view/Mypage/Screen/MyPage.kt (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • data/src/main/java/remote/datasource/users/UsersDataSource.kt
  • data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt
  • data/src/main/java/remote/dto/users/response/UsersResponse.kt
  • presentation/src/main/java/view/Mypage/Screen/MyPage.kt
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@kimjeakwan kimjeakwan added the 1️⃣ Priority: High μš°μ„ μˆœμœ„ - 상 label Jan 23, 2025
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: 16

πŸ”­ Outside diff range comments (1)
app/src/main/java/module/NetworkModule.kt (1)

Line range hint 63-63: baseUrl을 μƒμˆ˜λ‘œ λΆ„λ¦¬ν•˜μ„Έμš”.

ν•˜λ“œμ½”λ”©λœ "exple Base url"은 ν”„λ‘œλ•μ…˜ ν™˜κ²½μ—μ„œ μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€. BuildConfigλ‚˜ ν™˜κ²½ λ³€μˆ˜λ₯Ό 톡해 κ΄€λ¦¬ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

🧹 Nitpick comments (10)
presentation/src/main/java/viewModel/users/UsersViewModel.kt (1)

28-71: 쀑볡 μ½”λ“œ λ¦¬νŒ©ν† λ§ μ œμ•ˆ

getUsers()와 getMyRank() ν•¨μˆ˜μ—μ„œ μœ μ‚¬ν•œ 둜직이 반볡되고 μžˆμŠ΅λ‹ˆλ‹€. μ½”λ“œμ˜ μž¬μ‚¬μš©μ„±κ³Ό μœ μ§€λ³΄μˆ˜μ„±μ„ 높이기 μœ„ν•΄ 곡톡 λ‘œμ§μ„ λ³„λ„μ˜ ν•¨μˆ˜λ‘œ μΆ”μΆœν•˜λŠ” 것을 κ³ λ €ν•΄ λ³΄μ„Έμš”.

예λ₯Ό λ“€μ–΄, λ‹€μŒκ³Ό 같이 곡톡 λ‘œμ§μ„ μ²˜λ¦¬ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

private fun handleResult(result: Result<List<DataType>>) {
    when (result) {
        is Result.Loading -> _usersUiState.value = UsersUiState.Loading
        is Result.Error -> _usersUiState.value = UsersUiState.Fail
        is Result.Success -> {
            if (result.data.isEmpty()) {
                _usersUiState.value = UsersUiState.Empty
            } else {
                _usersUiState.value = UsersUiState.Success(result.data)
            }
        }
    }
}

그리고 각 ν•¨μˆ˜μ—μ„œλŠ” λ‹€μŒκ³Ό 같이 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

fun getUsers() = viewModelScope.launch {
    getUsersUseCase()
        .asResult()
        .collectLatest { result ->
            handleResult(result)
        }
}

fun getMyRank() = viewModelScope.launch {
    getRankUseCase()
        .asResult()
        .collectLatest { result ->
            handleResult(result)
        }
}
data/src/main/java/remote/api/auth/UsersAPi.kt (1)

6-6: 클래슀 μ΄λ¦„μ˜ 철자 였λ₯˜

μΈν„°νŽ˜μ΄μŠ€ 이름이 UsersAPi둜 λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 일반적인 넀이밍 μ»¨λ²€μ…˜μ— λ”°λ₯΄λ©΄ UsersApi둜 μˆ˜μ •ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜μ„Έμš”:

-interface UsersAPi {
+interface UsersApi {
presentation/src/main/java/viewModel/UIstate/UsersUiState.kt (1)

5-10: μƒνƒœ 이름을 더 ꡬ체적으둜 λ³€κ²½ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

ν˜„μž¬ μƒνƒœ 이름듀이 λ„ˆλ¬΄ μΌλ°˜μ μž…λ‹ˆλ‹€. μ‚¬μš©μž κ΄€λ ¨ μƒνƒœμž„μ„ λͺ…ν™•νžˆ ν•˜κΈ° μœ„ν•΄ λ‹€μŒκ³Ό 같이 λ³€κ²½ν•˜λŠ” 것을 μ œμ•ˆν•©λ‹ˆλ‹€:

sealed interface UsersUiState {
-    object Loading : UsersUiState
-    object Empty : UsersUiState
-    data class Success(val data: List<UsersResponseModel>) : UsersUiState
-    object Fail : UsersUiState
+    object UsersLoading : UsersUiState
+    object UsersEmpty : UsersUiState
+    data class UsersSuccess(val data: List<UsersResponseModel>) : UsersUiState
+    object UsersFail : UsersUiState
}
data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt (2)

9-12: μ½”λ“œ μŠ€νƒ€μΌ κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

클래슀 μ„ μ–ΈλΆ€μ˜ ν˜•μ‹μ„ κ°œμ„ ν•˜κ³  λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€:

+/**
+ * UsersDataSource κ΅¬ν˜„μ²΄
+ * μ‚¬μš©μž 정보λ₯Ό μ„œλ²„λ‘œλΆ€ν„° κ°€μ Έμ˜€λŠ” 역할을 λ‹΄λ‹Ήν•©λ‹ˆλ‹€.
+ */
class UsersDataSourceImpl @Inject constructor(
    private val usersService: UsersAPi
-): UsersDataSource
-{
+) : UsersDataSource {

14-16: λ©”μ„œλ“œ λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

getUsers λ©”μ„œλ“œμ— λŒ€ν•œ μ„€λͺ…을 μΆ”κ°€ν•˜κ³ , λ°˜ν™˜κ°’κ³Ό μ˜ˆμ™Έ μ²˜λ¦¬μ— λŒ€ν•œ λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€:

+    /**
+     * λͺ¨λ“  μ‚¬μš©μž 정보λ₯Ό κ°€μ Έμ˜΅λ‹ˆλ‹€.
+     * @return μ‚¬μš©μž 정보 λͺ©λ‘μ„ ν¬ν•¨ν•˜λŠ” Flow
+     * @throws IOException λ„€νŠΈμ›Œν¬ 였λ₯˜ λ°œμƒμ‹œ
+     * @throws HttpException API 호좜 μ‹€νŒ¨μ‹œ
+     */
    override fun getUsers(): Flow<List<UsersResponse>> =
        performApiRequest { usersService.getUsers() }
presentation/src/main/java/Untill/Result.kt (1)

15-17: asResult ν™•μž₯ ν•¨μˆ˜μ— μœ μš©ν•œ μœ ν‹Έλ¦¬ν‹° ν•¨μˆ˜ μΆ”κ°€λ₯Ό κ³ λ €ν•΄λ³΄μ„Έμš”

ν˜„μž¬ κ΅¬ν˜„μ€ 기본적인 κΈ°λŠ₯을 잘 μˆ˜ν–‰ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€λ§Œ, μ•„λž˜μ™€ 같은 μœ ν‹Έλ¦¬ν‹° ν•¨μˆ˜ μΆ”κ°€λ₯Ό κ³ λ €ν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

fun <T> Result<T>.getOrNull(): T? = when (this) {
    is Result.Success -> data
    else -> null
}

fun <T> Result<T>.getOrThrow(): T = when (this) {
    is Result.Success -> data
    is Result.Error -> throw exception
    is Result.Loading -> throw IllegalStateException("Loading state has no data")
}
data/src/main/java/remote/dto/users/response/UsersResponse.kt (2)

5-7: μ‚¬μš©ν•˜μ§€ μ•ŠλŠ” import 문을 μ œκ±°ν•˜μ„Έμš”.

MyRankResponseModelκ³Ό MyRankResponseλŠ” ν˜„μž¬ μ½”λ“œμ—μ„œ μ‚¬μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

-import model.myrank.response.MyRankResponseModel
-import remote.dto.myrank.response.MyRankResponse

13-19: JSON ν•„λ“œ μ΄λ¦„μ˜ λͺ…λͺ… κ·œμΉ™μ„ ν†΅μΌν•˜μ„Έμš”.

JSON ν•„λ“œ 이름이 일관성 없이 ν˜Όμš©λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€:

  • kebab-case: clean-Point, to-day-Clean, penalty-Point, Point-List
  • camelCase: userId, name, Mybecause, because

λ°±μ—”λ“œ νŒ€κ³Ό ν˜‘μ˜ν•˜μ—¬ μΌκ΄€λœ λͺ…λͺ… κ·œμΉ™(가급적 camelCase)을 μ‚¬μš©ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

app/src/main/java/module/NetworkModule.kt (1)

13-13: API 클래슀 μ΄λ¦„μ˜ 철자λ₯Ό μˆ˜μ •ν•˜μ„Έμš”.

UsersAPi의 'APi'λŠ” 'Api'둜 μˆ˜μ •λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€. ν”„λ‘œμ νŠΈ μ „μ²΄μ—μ„œ μΌκ΄€λœ λͺ…λͺ… κ·œμΉ™μ„ μœ μ§€ν•΄μ•Ό ν•©λ‹ˆλ‹€.

data/src/main/java/remote/datasource/users/UsersDataSource.kt (1)

6-10: λΆˆν•„μš”ν•œ 빈 쀄을 μ œκ±°ν•˜μ„Έμš”.

μΈν„°νŽ˜μ΄μŠ€ μ„ μ–Έκ³Ό λ©”μ„œλ“œ μ‚¬μ΄μ˜ λΆˆν•„μš”ν•œ 빈 쀄을 μ œκ±°ν•˜μ—¬ μ½”λ“œλ₯Ό 더 κΉ”λ”ν•˜κ²Œ λ§Œλ“œμ„Έμš”.

 interface UsersDataSource {
-

-
     fun getUsers(): Flow<List<UsersResponse>>
 }
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between f022d22 and 163bd06.

β›” Files ignored due to path filters (3)
  • buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin is excluded by !**/*.bin
  • buildSrc/build/kotlin/compileKotlin/local-state/build-history.bin is excluded by !**/*.bin
  • buildSrc/build/libs/buildSrc.jar is excluded by !**/*.jar
πŸ“’ Files selected for processing (18)
  • .idea/other.xml (1 hunks)
  • app/src/main/java/module/NetworkModule.kt (2 hunks)
  • app/src/main/java/module/RemoteDataSourceModule.kt (2 hunks)
  • app/src/main/java/module/RepositoryModule.kt (2 hunks)
  • data/src/main/java/remote/api/auth/UsersAPi.kt (1 hunks)
  • data/src/main/java/remote/datasource/users/UsersDataSource.kt (1 hunks)
  • data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt (1 hunks)
  • data/src/main/java/remote/dto/rank/response/RankResponse.kt (1 hunks)
  • data/src/main/java/remote/dto/users/response/UsersResponse.kt (1 hunks)
  • data/src/main/java/repoistory/UsersRepositoryImpl.kt (1 hunks)
  • domain/src/main/java/model/demerit/response/DemeritResponseModel.kt (0 hunks)
  • domain/src/main/java/model/users/response/UsersResponseModel.kt (1 hunks)
  • domain/src/main/java/reopoistory/UsersRepository.kt (1 hunks)
  • domain/src/main/java/usecase/Users/GetUsersUseCase.kt (1 hunks)
  • presentation/build.gradle.kts (4 hunks)
  • presentation/src/main/java/Untill/Result.kt (1 hunks)
  • presentation/src/main/java/viewModel/UIstate/UsersUiState.kt (1 hunks)
  • presentation/src/main/java/viewModel/users/UsersViewModel.kt (1 hunks)
πŸ’€ Files with no reviewable changes (1)
  • domain/src/main/java/model/demerit/response/DemeritResponseModel.kt
βœ… Files skipped from review due to trivial changes (1)
  • data/src/main/java/remote/dto/rank/response/RankResponse.kt
🧰 Additional context used
πŸͺ› GitHub Actions: Android CI
presentation/build.gradle.kts

[error] 65-65: Unresolved reference: lifecycle. The dependency 'libs.lifecycle.viewmodel.android' cannot be resolved.


[warning] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

πŸ”‡ Additional comments (5)
presentation/src/main/java/Untill/Result.kt (1)

8-13: Result μΈν„°νŽ˜μ΄μŠ€ κ΅¬ν˜„μ΄ 잘 λ˜μ—ˆμŠ΅λ‹ˆλ‹€

sealed interfaceλ₯Ό μ‚¬μš©ν•œ Result νƒ€μž… κ΅¬ν˜„μ΄ μ μ ˆν•©λ‹ˆλ‹€. Success, Error, Loading μƒνƒœλ₯Ό λͺ…ν™•ν•˜κ²Œ κ΅¬λΆ„ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

app/src/main/java/module/RepositoryModule.kt (1)

19-23: μ˜μ‘΄μ„± μ£Όμž… 섀정이 잘 λ˜μ—ˆμŠ΅λ‹ˆλ‹€

Hiltλ₯Ό μ‚¬μš©ν•œ Repository 바인딩이 μ μ ˆν•˜κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

app/src/main/java/module/RemoteDataSourceModule.kt (1)

19-22: 데이터 μ†ŒμŠ€ μ˜μ‘΄μ„± μ£Όμž… 섀정이 잘 λ˜μ—ˆμŠ΅λ‹ˆλ‹€

Hiltλ₯Ό μ‚¬μš©ν•œ DataSource 바인딩이 μ μ ˆν•˜κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

app/src/main/java/module/NetworkModule.kt (1)

79-83: API 제곡자 λ©”μ„œλ“œκ°€ μ˜¬λ°”λ₯΄κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

UsersAPiλ₯Ό μœ„ν•œ μ˜μ‘΄μ„± μ£Όμž…μ΄ μ μ ˆν•˜κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

.idea/other.xml (1)

17-27: OPPO CPH2557 κΈ°κΈ° ꡬ성이 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

κΈ°κΈ° ꡬ성이 μ˜¬λ°”λ₯΄κ²Œ μΆ”κ°€λ˜μ—ˆμœΌλ©° λ‹€λ₯Έ κΈ°κΈ°λ“€κ³Ό λ™μΌν•œ νŒ¨ν„΄μ„ λ”°λ₯΄κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‹€λ§Œ μ‹€μ œ 기기와 μΌμΉ˜ν•˜λŠ”μ§€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€.

μ‹€μ œ OPPO CPH2557 기기의 사양과 μΌμΉ˜ν•˜λŠ”μ§€ ν™•μΈν•˜κΈ° μœ„ν•΄ λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•΄μ£Όμ„Έμš”:

@@ -0,0 +1,9 @@
package reopoistory
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

package λͺ…에 μ˜€νƒ€κ°€ μžˆμŠ΅λ‹ˆλ‹€

ν˜„μž¬ νŒ¨ν‚€μ§€ λͺ…이 reopoistory둜 λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 이것은 repository의 μ˜€νƒ€λ‘œ λ³΄μž…λ‹ˆλ‹€. νŒ¨ν‚€μ§€ 이름을 μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜μ„Έμš”:

-package reopoistory
+package repository
πŸ“ 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
package reopoistory
package repository

@@ -0,0 +1,17 @@
package Untill
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

νŒ¨ν‚€μ§€ 이름 μ˜€νƒ€λ₯Ό μˆ˜μ •ν•΄μ£Όμ„Έμš”

Untill νŒ¨ν‚€μ§€ 이름이 Util의 μ˜€νƒ€λ‘œ λ³΄μž…λ‹ˆλ‹€. 일관성과 가독성을 μœ„ν•΄ μˆ˜μ •μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

-package Untill
+package util
πŸ“ 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
package Untill
package util

@@ -0,0 +1,18 @@
package repoistory
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

νŒ¨ν‚€μ§€ 이름 μ˜€νƒ€λ₯Ό μˆ˜μ •ν•΄μ£Όμ„Έμš”

repoistory νŒ¨ν‚€μ§€ 이름이 repository의 μ˜€νƒ€λ‘œ λ³΄μž…λ‹ˆλ‹€.

-package repoistory
+package repository
πŸ“ 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
package repoistory
package repository

Comment on lines +15 to +17
override suspend fun getUsers(): Flow<List<UsersResponseModel>> {
return usersDataSource.getUsers().map { list -> list.map { it.toModel() } }
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μ—λŸ¬ 처리 둜직 μΆ”κ°€λ₯Ό κ³ λ €ν•΄λ³΄μ„Έμš”

데이터 μ†ŒμŠ€μ—μ„œ λ°œμƒν•  수 μžˆλŠ” μ˜ˆμ™Έ 상황에 λŒ€ν•œ μ²˜λ¦¬κ°€ ν•„μš”ν•΄ λ³΄μž…λ‹ˆλ‹€.

 override suspend fun getUsers(): Flow<List<UsersResponseModel>> {
-    return usersDataSource.getUsers().map { list -> list.map { it.toModel() } }
+    return usersDataSource.getUsers()
+        .map { list -> list.map { it.toModel() } }
+        .catch { exception ->
+            // μ μ ˆν•œ λ‘œκΉ… μΆ”κ°€
+            throw exception
+        }
 }
πŸ“ 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
override suspend fun getUsers(): Flow<List<UsersResponseModel>> {
return usersDataSource.getUsers().map { list -> list.map { it.toModel() } }
}
override suspend fun getUsers(): Flow<List<UsersResponseModel>> {
return usersDataSource.getUsers()
.map { list -> list.map { it.toModel() } }
.catch { exception ->
// μ μ ˆν•œ λ‘œκΉ… μΆ”κ°€
throw exception
}
}

Comment on lines +9 to +10
import remote.datasource.users.UsersDataSource
import remote.datasource.users.UsersDataSourceImpl
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μž„ν¬νŠΈ 경둜λ₯Ό ν‘œμ€€ν™”ν•΄μ£Όμ„Έμš”

μž„ν¬νŠΈ 문이 일관성 없이 μž‘μ„±λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. λͺ¨λ“  μž„ν¬νŠΈλ₯Ό ν”„λ‘œμ νŠΈ λ£¨νŠΈλΆ€ν„° μ‹œμž‘ν•˜λ„λ‘ μˆ˜μ •ν•΄μ£Όμ„Έμš”.

-import remote.datasource.users.UsersDataSource
-import remote.datasource.users.UsersDataSourceImpl
+import com.kim.Dormitorymanager.remote.datasource.users.UsersDataSource
+import com.kim.Dormitorymanager.remote.datasource.users.UsersDataSourceImpl

Committable suggestion skipped: line range outside the PR's diff.

implementation(Dependency.Compose.COMPOSE_MATERIAL3)
implementation(Dependency.Compose.COMPOSE_MATERIAL)
implementation(Dependency.Compose.COMPOSE_NAVIGATION)
implementation(libs.lifecycle.viewmodel.android)
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

μ˜μ‘΄μ„± ν•΄κ²° 였λ₯˜λ₯Ό μˆ˜μ •ν•˜μ„Έμš”.

libs.lifecycle.viewmodel.android μ˜μ‘΄μ„±μ„ 찾을 수 μ—†μŠ΅λ‹ˆλ‹€. λ‹€μŒ 쀑 ν•˜λ‚˜μ˜ λ°©λ²•μœΌλ‘œ ν•΄κ²°ν•˜μ„Έμš”:

  1. 버전 μΉ΄νƒˆλ‘œκ·Έμ— μ˜μ‘΄μ„±μ„ μΆ”κ°€
  2. μ •ν™•ν•œ μ˜μ‘΄μ„± μ’Œν‘œλ₯Ό μ‚¬μš©

λ˜ν•œ Gradle 9.0과의 ν˜Έν™˜μ„± 문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄ μ΅œμ‹  문법을 μ‚¬μš©ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

🧰 Tools
πŸͺ› GitHub Actions: Android CI

[error] 65-65: Unresolved reference: lifecycle. The dependency 'libs.lifecycle.viewmodel.android' cannot be resolved.


[warning] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0

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: 1

🧹 Nitpick comments (2)
presentation/src/main/java/view/Mypage/Screen/MyPage.kt (2)

31-31: λ§€κ°œλ³€μˆ˜ λ¬Έμ„œν™” κ°œμ„  ν•„μš”

data λ§€κ°œλ³€μˆ˜μ— λŒ€ν•œ KDoc λ¬Έμ„œν™”κ°€ λˆ„λ½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ§€κ°œλ³€μˆ˜μ˜ λͺ©μ κ³Ό μ‚¬μš©λ²•μ„ λͺ…ν™•νžˆ μ„€λͺ…ν•˜λŠ” λ¬Έμ„œλ₯Ό μΆ”κ°€ν•΄ μ£Όμ„Έμš”.

+/**
+ * @param modifier μ»΄ν¬μ €λΈ”μ˜ μˆ˜μ •μž
+ * @param data μ‚¬μš©μž 정보 및 벌점 데이터λ₯Ό ν¬ν•¨ν•˜λŠ” 응닡 λͺ¨λΈ
+ */

126-138: 프리뷰 데이터 관리 κ°œμ„  ν•„μš”

프리뷰 데이터에 λŒ€ν•œ λͺ‡ κ°€μ§€ κ°œμ„ μ‚¬ν•­μ΄ μžˆμŠ΅λ‹ˆλ‹€:

  1. ν•˜λ“œμ½”λ”©λœ 값듀을 μƒμˆ˜λ‘œ λΆ„λ¦¬ν•˜μ—¬ 관리
  2. λ‹€μ–‘ν•œ μ‹œλ‚˜λ¦¬μ˜€ ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•œ μ—¬λŸ¬ 프리뷰 ν•¨μˆ˜ μΆ”κ°€
  3. UUIDλ₯Ό κ³ μ •κ°’μœΌλ‘œ μ„€μ •ν•˜μ—¬ μΌκ΄€λœ 프리뷰 제곡
+private object PreviewData {
+    val DEFAULT_USER = UsersResponseModel(
+        because = "λ…ΈνŠΈλΆ",
+        cleanPoint = 3,
+        mybecause = "λ…ΈνŠΈλΆ",
+        pointList = 3,
+        name = "이산",
+        penaltyPoint = 1,
+        todayClean = "ν™”μž₯μ‹€",
+        userId = UUID.fromString("550e8400-e29b-41d4-a716-446655440000")
+    )
+}

 @Composable
 @Preview
 fun PreviewMyPage() {
-    MyPage(
-        data = UsersResponseModel(
-            because = "λ…ΈνŠΈλΆ",
-            cleanPoint = 3,
-            Mybecause = "λ…ΈνŠΈλΆ",
-            PointList = 3,
-            name = "이산",
-            penaltyPoint = 1,
-            todayClean = "ν™”μž₯μ‹€",
-            userId = UUID.randomUUID(),
-        )
-    )
+    MyPage(data = PreviewData.DEFAULT_USER)
+}
+
+@Composable
+@Preview(name = "높은 벌점")
+fun PreviewMyPageHighPenalty() {
+    MyPage(data = PreviewData.DEFAULT_USER.copy(penaltyPoint = 5))
+}
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 163bd06 and cde2a15.

πŸ“’ Files selected for processing (1)
  • presentation/src/main/java/view/Mypage/Screen/MyPage.kt (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
πŸ”‡ Additional comments (1)
presentation/src/main/java/view/Mypage/Screen/MyPage.kt (1)

22-22: λͺ¨λΈ 변경에 λŒ€ν•œ 영ν–₯도 확인 ν•„μš”

DemeritResponseModelμ—μ„œ UsersResponseModel둜의 μ „ν™˜μ΄ μ΄λ£¨μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€. μ΄λŠ” μ‚¬μš©μž κ΄€λ ¨ 데이터 ꡬ쑰의 μ€‘μš”ν•œ 변경을 μ˜λ―Έν•©λ‹ˆλ‹€.

βœ… Verification successful

λͺ¨λΈ 변경이 μ•ˆμ „ν•˜κ²Œ μ΄λ£¨μ–΄μ‘ŒμŒμ„ ν™•μΈν–ˆμŠ΅λ‹ˆλ‹€

DemeritResponseModelμ—μ„œ UsersResponseModel둜의 μ „ν™˜μ΄ μ•„ν‚€ν…μ²˜μ˜ λͺ¨λ“  κ³„μΈ΅μ—μ„œ μΌκ΄€λ˜κ²Œ μ μš©λ˜μ—ˆμœΌλ©°, UI μ»΄ν¬λ„ŒνŠΈλ“€μ€ 데이터 λͺ¨λΈκ³Ό 적절히 λΆ„λ¦¬λ˜μ–΄ μžˆμ–΄ μ•ˆμ „ν•©λ‹ˆλ‹€.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining references to DemeritResponseModel
rg "DemeritResponseModel" --type kotlin

Length of output: 39


Script:

#!/bin/bash
# Search for UsersResponseModel references
echo "=== UsersResponseModel References ==="
rg "UsersResponseModel" --type kotlin -l

echo -e "\n=== Files containing 'demerit' (case insensitive) ==="
rg -i "demerit" --type kotlin -l

echo -e "\n=== Model package structure ==="
fd . "model" --type d

Length of output: 1069


Script:

#!/bin/bash
# Check content of Demerit-related files
echo "=== DemeritList.kt content ==="
cat presentation/src/main/java/view/Mypage/component/DemeritList.kt

echo -e "\n=== MyDemeritList.kt content ==="
cat presentation/src/main/java/view/Mypage/component/MyDemeritList.kt

Length of output: 5720

Comment on lines +86 to 88
data.todayClean,
data.penaltyPoint,
data.cleanPoint,
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

ν”„λ‘œνΌν‹° λͺ…λͺ… κ·œμΉ™ 톡일 ν•„μš”

ν”„λ‘œνΌν‹° μ΄λ¦„μ—μ„œ 일관성 μ—†λŠ” λͺ…λͺ… κ·œμΉ™μ΄ λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€:

  • todayClean: camelCase
  • Mybecause: PascalCase
  • PointList: PascalCase

Kotlin λͺ…λͺ… κ·œμΉ™μ— 따라 λͺ¨λ“  ν”„λ‘œνΌν‹°λŠ” camelCaseλ₯Ό μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.

-    data.Mybecause,
-    data.PointList,
+    data.mybecause,
+    data.pointList,

Also applies to: 101-102, 115-115

@Team-MindWay Team-MindWay deleted a comment from coderabbitai bot Jan 23, 2025
@Team-MindWay Team-MindWay deleted a comment from coderabbitai bot Jan 23, 2025
@Json(name = "to-day-Clean") val todayClean: String,
@Json(name = "name") val name: String,
@Json(name = "penalty-Point") val penaltyPoint: Int,
@Json(name = "Mybecause") val Mybecause: String,
Copy link
Member

Choose a reason for hiding this comment

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

kotlin ꢌμž₯사항애 λ”°λΌμ„œ μΉ΄λ©œμΌ€μ΄μŠ€λ₯Ό μ‚¬μš©ν•΄μ£Όμ„Έμš”

@kimjeakwan kimjeakwan merged commit 5404eae into develop Jan 24, 2025
2 checks passed
@kimjeakwan kimjeakwan deleted the feature/48-UserApi branch January 24, 2025 03:06
kimjeakwan added a commit that referenced this pull request Feb 3, 2025
πŸ”€ :: (#50) - androidTheme λ₯Ό μΆ”κ°€ν–ˆμŠ΅λ‹ˆλ‹€.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1️⃣ Priority: High μš°μ„ μˆœμœ„ - 상

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants