Skip to content

Commit

Permalink
[Chore] Refactor data module packages
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Oct 5, 2023
1 parent 0a6b800 commit 2b09924
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.template.compose.di.modules

import co.nimblehq.template.compose.data.services.providers.MoshiBuilderProvider
import co.nimblehq.template.compose.data.remote.providers.MoshiBuilderProvider
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.nimblehq.template.compose.di.modules

import co.nimblehq.template.compose.data.remote.services.ApiService
import co.nimblehq.template.compose.data.repositories.RepositoryImpl
import co.nimblehq.template.compose.data.services.ApiService
import co.nimblehq.template.compose.domain.repositories.Repository
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.template.compose.di.modules

import co.nimblehq.template.compose.BuildConfig
import co.nimblehq.template.compose.data.services.ApiService
import co.nimblehq.template.compose.data.services.providers.*
import co.nimblehq.template.compose.data.remote.providers.*
import co.nimblehq.template.compose.data.remote.services.ApiService
import com.squareup.moshi.Moshi
import dagger.Module
import dagger.Provides
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.nimblehq.template.compose.di.modules

import android.content.Context
import co.nimblehq.template.compose.data.storages.EncryptedSharedPreferences
import co.nimblehq.template.compose.data.local.storages.EncryptedSharedPreferences
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.template.compose.data.extensions

import co.nimblehq.template.compose.data.responses.ErrorResponse
import co.nimblehq.template.compose.data.responses.toModel
import co.nimblehq.template.compose.data.services.providers.MoshiBuilderProvider
import co.nimblehq.template.compose.data.remote.models.responses.ErrorResponse
import co.nimblehq.template.compose.data.remote.models.responses.toModel
import co.nimblehq.template.compose.data.remote.providers.MoshiBuilderProvider
import co.nimblehq.template.compose.domain.exceptions.ApiException
import co.nimblehq.template.compose.domain.exceptions.NoConnectivityException
import com.squareup.moshi.JsonDataException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.storages
package co.nimblehq.template.compose.data.local.storages

import android.content.SharedPreferences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.storages
package co.nimblehq.template.compose.data.local.storages

import android.content.Context
import androidx.security.crypto.EncryptedSharedPreferences
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.storages
package co.nimblehq.template.compose.data.local.storages

import android.content.SharedPreferences

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.responses
package co.nimblehq.template.compose.data.remote.models.responses

import co.nimblehq.template.compose.domain.models.Error
import com.squareup.moshi.Json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.responses
package co.nimblehq.template.compose.data.remote.models.responses

import co.nimblehq.template.compose.domain.models.Model
import com.squareup.moshi.Json
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.template.compose.data.services.providers
package co.nimblehq.template.compose.data.remote.providers

import co.nimblehq.template.compose.data.services.ApiService
import co.nimblehq.template.compose.data.remote.services.ApiService
import retrofit2.Retrofit

object ApiServiceProvider {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.services.providers
package co.nimblehq.template.compose.data.remote.providers

import com.squareup.moshi.Moshi
import retrofit2.Converter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.services.providers
package co.nimblehq.template.compose.data.remote.providers

import com.squareup.moshi.Moshi
import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package co.nimblehq.template.compose.data.services.providers
package co.nimblehq.template.compose.data.remote.providers

import okhttp3.OkHttpClient
import retrofit2.Converter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package co.nimblehq.template.compose.data.remote.services

import co.nimblehq.template.compose.data.remote.models.responses.Response
import retrofit2.http.GET

interface ApiService {

@GET("users")
suspend fun getResponses(): List<Response>
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package co.nimblehq.template.compose.data.repositories

import co.nimblehq.template.compose.data.extensions.flowTransform
import co.nimblehq.template.compose.data.responses.toModels
import co.nimblehq.template.compose.data.services.ApiService
import co.nimblehq.template.compose.data.remote.models.responses.toModels
import co.nimblehq.template.compose.data.remote.services.ApiService
import co.nimblehq.template.compose.domain.models.Model
import co.nimblehq.template.compose.domain.repositories.Repository
import kotlinx.coroutines.flow.Flow
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.template.compose.data.extensions

import co.nimblehq.template.compose.data.responses.toModel
import co.nimblehq.template.compose.data.remote.models.responses.toModel
import co.nimblehq.template.compose.data.test.MockUtil
import co.nimblehq.template.compose.domain.exceptions.ApiException
import co.nimblehq.template.compose.domain.exceptions.NoConnectivityException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package co.nimblehq.template.compose.data.repositories

import co.nimblehq.template.compose.data.responses.toModels
import co.nimblehq.template.compose.data.services.ApiService
import co.nimblehq.template.compose.data.remote.models.responses.toModels
import co.nimblehq.template.compose.data.remote.services.ApiService
import co.nimblehq.template.compose.data.test.MockUtil
import co.nimblehq.template.compose.domain.repositories.Repository
import io.kotest.matchers.shouldBe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package co.nimblehq.template.compose.data.test

import co.nimblehq.template.compose.data.responses.ErrorResponse
import co.nimblehq.template.compose.data.remote.models.responses.ErrorResponse
import io.mockk.every
import io.mockk.mockk
import okhttp3.ResponseBody
Expand Down Expand Up @@ -31,6 +31,6 @@ object MockUtil {
)

val responses = listOf(
co.nimblehq.template.compose.data.responses.Response(id = 1)
co.nimblehq.template.compose.data.remote.models.responses.Response(id = 1)
)
}

0 comments on commit 2b09924

Please sign in to comment.