Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b7380a1
:fire: :: DemeritResponseModel μ‚­μ œ
kimjeakwan Jan 23, 2025
c3e93b7
:sparkles: :: Result
kimjeakwan Jan 23, 2025
e472c3a
:sparkles: :: UserAPi
kimjeakwan Jan 23, 2025
7b31216
:sparkles: :: UsersDataSource.kt
kimjeakwan Jan 23, 2025
916338a
:sparkles: :: UsersDataSourceImpl.kt
kimjeakwan Jan 23, 2025
a0b8d83
:sparkles: :: UsersRepository.kt
kimjeakwan Jan 23, 2025
2b5e757
:sparkles: :: UsersRepositoryImpl.kt
kimjeakwan Jan 23, 2025
a2b4879
:sparkles: :: UsersResponse
kimjeakwan Jan 23, 2025
dd27058
:sparkles: ::UsersResponseModel.kt
kimjeakwan Jan 23, 2025
b65c5af
:sparkles: :: UsersUiState.kt
kimjeakwan Jan 23, 2025
3d0132e
:sparkles: :: UsersViewModel.kt
kimjeakwan Jan 23, 2025
24575b4
:sparkles: :: GetUsersUseCase.kt
kimjeakwan Jan 23, 2025
31dfe27
:memo: :: add file
kimjeakwan Jan 23, 2025
9754c92
:recycle: Mapper name toModel 둜 λ³€κ²½
kimjeakwan Jan 23, 2025
49dc5e9
:heavy_plus_sign: :: NetworkModule.kt 에 User APi μΆ”κ°€
kimjeakwan Jan 23, 2025
e720c22
:heavy_plus_sign: :: RemoteDataSourceModule.kt 에 UserDatasource μΆ”κ°€
kimjeakwan Jan 23, 2025
163bd06
:heavy_plus_sign: :: RepositoryModule.kt 에 UserRepositoryμΆ”κ°€
kimjeakwan Jan 23, 2025
cde2a15
:recycle: :: UserResponseModel μΆ”κ°€
kimjeakwan Jan 23, 2025
def4677
:heavy_minus_sign: :: (libs.lifecycle.viewmodel.android) μ˜μ‘΄μ„± μ‚­μ œ
kimjeakwan Jan 23, 2025
d93c9b9
:recycle: :: μ“°μ§€ μ•ŠλŠ” import λ¬Έ 정리
kimjeakwan Jan 23, 2025
95c9bd0
:memo: :: Add file
kimjeakwan Jan 23, 2025
ca0302f
:memo: :: Add file
kimjeakwan Jan 24, 2025
4879191
:recycle: :: homes κ³Όλ ¨ import λ¬Έ μ‚­μ œ
kimjeakwan Jan 24, 2025
51069c8
:recycle: :: kotlin ꢌμž₯사황에 따라 μΉ΄λ©œμΌ€μ΄μŠ€λ‘œ λ³€κ²½
kimjeakwan Jan 24, 2025
8911cdf
:recycle: :: kotlin ꢌμž₯사황에 따라 μΉ΄λ©œμΌ€μ΄μŠ€λ‘œ λ³€κ²½
kimjeakwan Jan 24, 2025
796e680
:recycle: :: UserResponse 에 변경사황 적용
kimjeakwan Jan 24, 2025
cc2ae64
:recycle: :: κ³΅λ°±μ‚­μ œ
kimjeakwan Jan 24, 2025
ff3cfd4
:recycle: :: κ³΅λ°±μ‚­μ œ
kimjeakwan Jan 24, 2025
8691bca
:recycle: :: κ³΅λ°±μ‚­μ œ
kimjeakwan Jan 24, 2025
14ecf7b
:recycle: :: κ³΅λ°±μ‚­μ œ
kimjeakwan Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/src/main/java/module/NetworkModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import dagger.hilt.components.SingletonComponent
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import remote.api.auth.AuthApi
import remote.api.auth.UsersAPi
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.create
Expand Down Expand Up @@ -75,4 +76,9 @@ object NetworkModule {
fun provideAuthAPi(retrofit: Retrofit): AuthApi{
return retrofit.create(AuthApi::class.java)
}
@Provides
@Singleton
fun provideUserAPi(retrofit: Retrofit): UsersAPi{
return retrofit.create(UsersAPi::class.java)
}
}
6 changes: 6 additions & 0 deletions app/src/main/java/module/RemoteDataSourceModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import remote.datasource.GAuthDataSource
import remote.datasource.users.UsersDataSource
import remote.datasource.users.UsersDataSourceImpl
Comment on lines +9 to +10
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.


@Module
@InstallIn(SingletonComponent::class)
Expand All @@ -14,4 +16,8 @@ abstract class RemoteDataSourceModule {
abstract fun provideAuthDatasource(
gAuthDataSourceImpl: GAuthDataSourceImpl
): GAuthDataSource
@Binds
abstract fun provideUsersDatasource(
usersDataSourceImpl: UsersDataSourceImpl
): UsersDataSource
}
7 changes: 7 additions & 0 deletions app/src/main/java/module/RepositoryModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import reopoistory.UsersRepository
import repository.AuthRepository
import repoistory.AuthRepositoryImpl
import repoistory.UsersRepositoryImpl

@Module
@InstallIn(SingletonComponent::class)
Expand All @@ -14,4 +16,9 @@ abstract class RepositoryModule {
abstract fun providerAuthRepository(
authRepositoryImpl: AuthRepositoryImpl
):AuthRepository
@Binds
abstract fun providerUsersRepository(
usersRepositoryImpl: UsersRepositoryImpl
): UsersRepository

}
Binary file modified buildSrc/build/kotlin/compileKotlin/cacheable/last-build.bin
Binary file not shown.
Binary file not shown.
Binary file modified buildSrc/build/libs/buildSrc.jar
Binary file not shown.
16 changes: 16 additions & 0 deletions data/src/main/java/remote/api/auth/UsersAPi.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package remote.api.auth

import remote.dto.users.response.UsersResponse
import retrofit2.http.GET

interface UsersAPi {
@GET("/{user_id}/profile")
suspend fun getUsers(): List<UsersResponse>
Comment on lines +7 to +8
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

API μ—”λ“œν¬μΈνŠΈμ™€ λ°˜ν™˜ νƒ€μž…μ˜ 뢈일치

@GET("/{user_id}/profile") μ—”λ“œν¬μΈνŠΈλŠ” νŠΉμ • μ‚¬μš©μž ID의 ν”„λ‘œν•„μ„ κ°€μ Έμ˜€λŠ” κ²ƒμœΌλ‘œ λ³΄μ΄μ§€λ§Œ, ν•¨μˆ˜λŠ” getUsers()이며 List<UsersResponse>λ₯Ό λ°˜ν™˜ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μ—”λ“œν¬μΈνŠΈμ™€ ν•¨μˆ˜μ˜ λͺ©μ μ΄ μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

λͺ©μ μ— 따라 μ—”λ“œν¬μΈνŠΈ λ˜λŠ” ν•¨μˆ˜λͺ…을 μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

  • νŠΉμ • μ‚¬μš©μžμ˜ ν”„λ‘œν•„μ„ κ°€μ Έμ˜€λŠ” 경우:
 @GET("/{user_id}/profile")
-suspend fun getUsers(): List<UsersResponse>
+suspend fun getUserProfile(@Path("user_id") userId: String): UsersResponse
  • λͺ¨λ“  μ‚¬μš©μžμ˜ λͺ©λ‘μ„ κ°€μ Έμ˜€λŠ” 경우:
-@GET("/{user_id}/profile")
+@GET("/users/profiles")
 suspend fun getUsers(): List<UsersResponse>

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








}
10 changes: 10 additions & 0 deletions data/src/main/java/remote/datasource/users/UsersDataSource.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package remote.datasource.users

import kotlinx.coroutines.flow.Flow
import remote.dto.users.response.UsersResponse

interface UsersDataSource {


fun getUsers(): Flow<List<UsersResponse>>
}
16 changes: 16 additions & 0 deletions data/src/main/java/remote/datasource/users/UsersDataSourceImpl.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package remote.datasource.users

import kotlinx.coroutines.flow.Flow
import remote.api.auth.UsersAPi
import remote.dto.users.response.UsersResponse
import util.performApiRequest
import javax.inject.Inject

class UsersDataSourceImpl @Inject constructor(
private val usersService: UsersAPi
): UsersDataSource
{

override fun getUsers(): Flow<List<UsersResponse>> =
performApiRequest { usersService.getUsers() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class RankResponse(
@Json(name = "penaltyPoint") val penaltyPoint: Int,
)

fun RankResponse.toRank() = RankResponseModel(
fun RankResponse.toModel() = RankResponseModel(
userId = userId,
rank = rank,
name = name,
Expand Down
33 changes: 33 additions & 0 deletions data/src/main/java/remote/dto/users/response/UsersResponse.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package remote.dto.users.response

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import model.myrank.response.MyRankResponseModel
import model.users.response.UsersResponseModel
import remote.dto.myrank.response.MyRankResponse
import java.util.UUID

@JsonClass(generateAdapter = true)
data class UsersResponse (
@Json(name = "userId") val userId: UUID,
@Json(name = "clean-Point") val cleanPoint: Int,
@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 ꢌμž₯사항애 λ”°λΌμ„œ μΉ΄λ©œμΌ€μ΄μŠ€λ₯Ό μ‚¬μš©ν•΄μ£Όμ„Έμš”

@Json(name = "because") val because: String,
@Json(name = "Point-List") val PointList: Int,

)

fun UsersResponse.toModel() = UsersResponseModel(
userId = userId,
cleanPoint = cleanPoint,
todayClean = todayClean,
name = name,
penaltyPoint = penaltyPoint,
Mybecause = Mybecause,
because = because,
PointList = PointList

)
18 changes: 18 additions & 0 deletions data/src/main/java/repoistory/UsersRepositoryImpl.kt
Original file line number Diff line number Diff line change
@@ -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


import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import model.users.response.UsersResponseModel
import remote.datasource.users.UsersDataSource
import remote.dto.users.response.toModel
import reopoistory.UsersRepository
import javax.inject.Inject

class UsersRepositoryImpl @Inject constructor(
private val usersDataSource: UsersDataSource
): UsersRepository {

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

}

This file was deleted.

14 changes: 14 additions & 0 deletions domain/src/main/java/model/users/response/UsersResponseModel.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package model.users.response

import java.util.UUID

data class UsersResponseModel (
val userId: UUID,
val cleanPoint: Int,
val todayClean: String,
val name: String,
val penaltyPoint: Int,
val Mybecause: String,
val because: String,
val PointList: Int,
)
Comment on lines 5 to 14
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

ν”„λ‘œνΌν‹° λͺ…λͺ… κ·œμΉ™μ„ μˆ˜μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€.

  1. ν”„λ‘œνΌν‹° 이름이 Kotlin λͺ…λͺ… κ·œμΉ™μ„ λ”°λ₯΄μ§€ μ•ŠμŠ΅λ‹ˆλ‹€:
  • Mybecause와 PointListλŠ” 카멜 μΌ€μ΄μŠ€λ‘œ λ³€κ²½λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.
  • becauseλŠ” 더 ꡬ체적인 이름이 ν•„μš”ν•©λ‹ˆλ‹€.
  1. 일뢀 ν•„λ“œμ— λŒ€ν•œ μœ νš¨μ„± 검사가 ν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€:
  • cleanPoint와 penaltyPointλŠ” μŒμˆ˜κ°€ 될 수 없을 것 κ°™μŠ΅λ‹ˆλ‹€.
data class UsersResponseModel (
     val userId: UUID,
-    val cleanPoint: Int,
+    val cleanPoint: Int = 0,
     val todayClean: String,
     val name: String,
-    val penaltyPoint: Int,
+    val penaltyPoint: Int = 0,
-    val Mybecause: String,
+    val myReason: String,
-    val because: String,
+    val penaltyReason: String,
-    val PointList: Int,
+    val pointList: Int,
)
πŸ“ 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
data class UsersResponseModel (
val userId: UUID,
val cleanPoint: Int,
val todayClean: String,
val name: String,
val penaltyPoint: Int,
val Mybecause: String,
val because: String,
val PointList: Int,
)
data class UsersResponseModel (
val userId: UUID,
val cleanPoint: Int = 0,
val todayClean: String,
val name: String,
val penaltyPoint: Int = 0,
val myReason: String,
val penaltyReason: String,
val pointList: Int,
)

9 changes: 9 additions & 0 deletions domain/src/main/java/reopoistory/UsersRepository.kt
Original file line number Diff line number Diff line change
@@ -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


import kotlinx.coroutines.flow.Flow
import model.users.response.UsersResponseModel

interface UsersRepository {

suspend fun getUsers(): Flow<List<UsersResponseModel>>
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

suspend ν‚€μ›Œλ“œ λΆˆν•„μš”

Flowλ₯Ό λ°˜ν™˜ν•˜λŠ” ν•¨μˆ˜μ—μ„œλŠ” suspend ν‚€μ›Œλ“œκ°€ ν•„μš”ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. Flow μžμ²΄κ°€ 비동기 μŠ€νŠΈλ¦Όμ„ μ œκ³΅ν•˜λ―€λ‘œ suspendλ₯Ό μ œκ±°ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

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

-    suspend fun getUsers(): Flow<List<UsersResponseModel>>
+    fun getUsers(): Flow<List<UsersResponseModel>>
πŸ“ 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
suspend fun getUsers(): Flow<List<UsersResponseModel>>
fun getUsers(): Flow<List<UsersResponseModel>>

}
13 changes: 13 additions & 0 deletions domain/src/main/java/usecase/Users/GetUsersUseCase.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package usecase.Users

import kotlinx.coroutines.flow.Flow
import model.users.response.UsersResponseModel
import reopoistory.UsersRepository
import javax.inject.Inject

class GetUsersUseCase @Inject constructor(
private val usersRepository: UsersRepository
){
suspend operator fun invoke(): Flow<List<UsersResponseModel>> =
usersRepository.getUsers()
}
Comment on lines +11 to +13
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μ—λŸ¬ 처리 둜직이 ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ κ΅¬ν˜„μ€ 기본적인 데이터 νλ¦„λ§Œ μ²˜λ¦¬ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. λ‹€μŒκ³Ό 같은 μ—λŸ¬ 처리λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€:

  • λ„€νŠΈμ›Œν¬ 였λ₯˜
  • μ„œλ²„ 응닡 였λ₯˜
  • 데이터 λ³€ν™˜ 였λ₯˜
suspend operator fun invoke(): Flow<List<UsersResponseModel>> =
-    usersRepository.getUsers()
+    try {
+        usersRepository.getUsers()
+    } catch (e: Exception) {
+        throw UserException("μ‚¬μš©μž 정보λ₯Ό κ°€μ Έμ˜€λŠ”λ° μ‹€νŒ¨ν–ˆμŠ΅λ‹ˆλ‹€", e)
+    }

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

27 changes: 9 additions & 18 deletions presentation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import java.io.FileInputStream
import java.util.Properties


plugins {
id(Dependency.Gradle.KOTLIN)
Expand All @@ -13,15 +12,11 @@ android {
compileSdk = ProjectProperties.Versions.COMPILE_SDK

defaultConfig {

minSdk = ProjectProperties.Versions.MIN_SDK
targetSdk = ProjectProperties.Versions.TARGET_SDK


testInstrumentationRunner = ProjectProperties.Test.TEST_RUNNER
vectorDrawables {
useSupportLibrary = true
}
consumerProguardFiles(ProjectProperties.Files.CONSUMER_PROGUARD_FILES)


}

Expand All @@ -35,28 +30,24 @@ android {
}
}
compileOptions {
sourceCompatibility = ProjectProperties.Versions.JAVA_VERSION
sourceCompatibility = ProjectProperties.Versions.JAVA_VERSION
targetCompatibility = ProjectProperties.Versions.JAVA_VERSION
}
kotlinOptions {
jvmTarget = ProjectProperties.Versions.JVM_TARGET
}
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {
kotlinCompilerExtensionVersion = Versions.COMPOSE
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
buildFeatures {
compose = true
buildConfig = true
}
}

dependencies {
implementation(project(":domain"))

implementation(Dependency.AndroidX.CORE_KTX)
implementation(Dependency.AndroidX.LIFECYCLE)
implementation(Dependency.AndroidX.SPLASH)
Expand All @@ -71,6 +62,7 @@ dependencies {
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

debugImplementation(Dependency.Compose.COMPOSE_TOOLING)

implementation(Dependency.Hilt.HILT)
Expand All @@ -92,6 +84,5 @@ dependencies {
implementation(Dependency.Google.SWIPE_REFRESH)

implementation(Dependency.Compose.COMPOSE_IMMUTABLELIST)

}

17 changes: 17 additions & 0 deletions presentation/src/main/java/Untill/Result.kt
Original file line number Diff line number Diff line change
@@ -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


import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart

sealed interface Result<out T>{
data class Success<out T>(val data: T) : Result<T>
data class Error(val exception: Throwable) : Result<Nothing>
object Loading : Result<Nothing>

}

fun <T> Flow<T>.asResult(): Flow<Result<T>> = map<T, Result<T>> { Result.Success(it) }
.onStart { emit(Result.Loading) }
.catch { emit(Result.Error(it)) }
10 changes: 10 additions & 0 deletions presentation/src/main/java/viewModel/UIstate/UsersUiState.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package viewModel.UIstate

import model.users.response.UsersResponseModel

sealed interface UsersUiState {
object Loading : UsersUiState
object Empty : UsersUiState
data class Success(val data: List<UsersResponseModel>) : UsersUiState
object Fail : UsersUiState
}
Loading
Loading