-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...chive/app/src/main/java/com/droidblossom/archive/data/model/sms_message/SMSRequestData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.droidblossom.archive.data.model.sms_message | ||
|
||
data class SMSRequestData( | ||
val phoneNumber: String, | ||
val deviceId: String | ||
) |
6 changes: 6 additions & 0 deletions
6
.../src/main/java/com/droidblossom/archive/data/model/sms_message/SMSVerificationResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.droidblossom.archive.data.model.sms_message | ||
|
||
data class SMSVerificationResponse( | ||
val code : String, | ||
// 시간, 번호, 등등? | ||
) |
10 changes: 10 additions & 0 deletions
10
...ve/app/src/main/java/com/droidblossom/archive/data/repository/SMSMessageRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.droidblossom.archive.data.repository | ||
|
||
import com.droidblossom.archive.data.source.remote.api.SMSMessageService | ||
import com.droidblossom.archive.domain.repository.SMSMessageRepository | ||
import javax.inject.Inject | ||
|
||
class SMSMessageRepositoryImpl @Inject constructor( | ||
private val smsMessageService: SMSMessageService | ||
) : SMSMessageRepository { | ||
} |
4 changes: 4 additions & 0 deletions
4
...ve/app/src/main/java/com/droidblossom/archive/data/source/remote/api/SMSMessageService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.droidblossom.archive.data.source.remote.api | ||
|
||
interface SMSMessageService { | ||
} |
5 changes: 5 additions & 0 deletions
5
frontend/ARchive/app/src/main/java/com/droidblossom/archive/domain/model/SMSMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.droidblossom.archive.domain.model | ||
|
||
data class SMSMessage( | ||
val content : String | ||
) |
4 changes: 4 additions & 0 deletions
4
...hive/app/src/main/java/com/droidblossom/archive/domain/repository/SMSMessageRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.droidblossom.archive.domain.repository | ||
|
||
interface SMSMessageRepository { | ||
} |
8 changes: 8 additions & 0 deletions
8
...nd/ARchive/app/src/main/java/com/droidblossom/archive/domain/usecase/SMSMessageUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.droidblossom.archive.domain.usecase | ||
|
||
import javax.inject.Inject | ||
|
||
class SMSMessageUseCase @Inject constructor( | ||
private val smsMessageUseCase: SMSMessageUseCase | ||
){ | ||
} |
21 changes: 21 additions & 0 deletions
21
frontend/ARchive/app/src/main/java/com/droidblossom/di/RepositoryModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.droidblossom.di | ||
|
||
import com.droidblossom.archive.data.repository.SMSMessageRepositoryImpl | ||
import com.droidblossom.archive.data.source.remote.api.SMSMessageService | ||
import com.droidblossom.archive.domain.repository.SMSMessageRepository | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ViewModelComponent | ||
import dagger.hilt.android.scopes.ViewModelScoped | ||
|
||
@Module | ||
@InstallIn(ViewModelComponent::class) | ||
object RepositoryModule { | ||
|
||
@Provides | ||
@ViewModelScoped | ||
fun providesSMSMessageRepository( | ||
smsMessageService: SMSMessageService | ||
) : SMSMessageRepository = SMSMessageRepositoryImpl(smsMessageService) | ||
} |
56 changes: 56 additions & 0 deletions
56
frontend/ARchive/app/src/main/java/com/droidblossom/di/RetrofitModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.droidblossom.di | ||
|
||
import com.google.gson.GsonBuilder | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import okhttp3.OkHttpClient | ||
import okhttp3.logging.HttpLoggingInterceptor | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import java.util.concurrent.TimeUnit | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object RetrofitModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun providesConverterFactory() : GsonConverterFactory{ | ||
return GsonConverterFactory.create( | ||
GsonBuilder() | ||
.create() | ||
) | ||
} | ||
|
||
@Singleton | ||
@Provides | ||
fun providesOkHttpClient() : OkHttpClient.Builder{ | ||
return OkHttpClient.Builder().apply { | ||
connectTimeout(5, TimeUnit.SECONDS) | ||
readTimeout(5, TimeUnit.SECONDS) | ||
writeTimeout(5, TimeUnit.SECONDS) | ||
addInterceptor(HttpLoggingInterceptor().apply { | ||
level = HttpLoggingInterceptor.Level.BODY | ||
}) | ||
} | ||
} | ||
|
||
//TODO baseurl ignore 시켜야함 | ||
/* | ||
@Provides | ||
@Singleton | ||
fun providesRetrofit( | ||
client : OkHttpClient.Builder, | ||
gsonConverterFactory: GsonConverterFactory | ||
) : Retrofit { | ||
return Retrofit.Builder() | ||
.baseUrl("") | ||
.addConverterFactory(gsonConverterFactory) | ||
.client(client.build()) | ||
.build() | ||
} | ||
*/ | ||
} |
18 changes: 18 additions & 0 deletions
18
frontend/ARchive/app/src/main/java/com/droidblossom/di/ServiceModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.droidblossom.di | ||
|
||
import com.droidblossom.archive.data.source.remote.api.SMSMessageService | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import retrofit2.Retrofit | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object ServiceModule { | ||
|
||
@Singleton | ||
@Provides | ||
fun providesSMSMessageService(retrofit: Retrofit) : SMSMessageService = retrofit.create(SMSMessageService::class.java) | ||
} |