-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from FakeDevelopers/feature/BDBD-503
FEAT : BDBD-503 로그인 / 메인 액티비티 분리
- Loading branch information
Showing
14 changed files
with
221 additions
and
160 deletions.
There are no files selected for viewing
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
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
38 changes: 38 additions & 0 deletions
38
app/src/main/kotlin/com/fakedevelopers/bidderbidder/api/di/LoginModule.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,38 @@ | ||
package com.fakedevelopers.bidderbidder.api.di | ||
|
||
import com.fakedevelopers.bidderbidder.api.repository.SigninGoogleRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.UserLoginRepository | ||
import com.fakedevelopers.bidderbidder.api.service.SigninGoogleService | ||
import com.fakedevelopers.bidderbidder.api.service.UserLoginService | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ViewModelComponent | ||
import dagger.hilt.android.scopes.ViewModelScoped | ||
import retrofit2.Retrofit | ||
|
||
@Module | ||
@InstallIn(ViewModelComponent::class) | ||
class LoginModule { | ||
// 로그인 요청 | ||
@ViewModelScoped | ||
@Provides | ||
fun provideUserLoginService(@NormalRetrofit retrofit: Retrofit): UserLoginService = retrofit.create( | ||
UserLoginService::class.java | ||
) | ||
|
||
@ViewModelScoped | ||
@Provides | ||
fun provideUserLoginRepository(service: UserLoginService): UserLoginRepository = UserLoginRepository(service) | ||
|
||
// 구글 로그인 요청 | ||
@ViewModelScoped | ||
@Provides | ||
fun provideSigninGoogleService(@AuthRetrofit retrofit: Retrofit): SigninGoogleService = | ||
retrofit.create(SigninGoogleService::class.java) | ||
|
||
@ViewModelScoped | ||
@Provides | ||
fun provideSigninGoogleRepository(service: SigninGoogleService): SigninGoogleRepository = | ||
SigninGoogleRepository(service) | ||
} |
90 changes: 90 additions & 0 deletions
90
app/src/main/kotlin/com/fakedevelopers/bidderbidder/api/di/MainModule.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,90 @@ | ||
package com.fakedevelopers.bidderbidder.api.di | ||
|
||
import com.fakedevelopers.bidderbidder.api.repository.ChatRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.ProductCategoryRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.ProductDetailRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.ProductListRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.ProductRegistrationRepository | ||
import com.fakedevelopers.bidderbidder.api.repository.ProductSearchRepository | ||
import com.fakedevelopers.bidderbidder.api.service.ChatService | ||
import com.fakedevelopers.bidderbidder.api.service.ProductCategoryService | ||
import com.fakedevelopers.bidderbidder.api.service.ProductDetailService | ||
import com.fakedevelopers.bidderbidder.api.service.ProductListService | ||
import com.fakedevelopers.bidderbidder.api.service.ProductRegistrationService | ||
import com.fakedevelopers.bidderbidder.api.service.ProductSearchService | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.components.ActivityRetainedComponent | ||
import dagger.hilt.android.scopes.ActivityRetainedScoped | ||
import retrofit2.Retrofit | ||
|
||
@Module | ||
@InstallIn(ActivityRetainedComponent::class) | ||
class MainModule { | ||
// 게시글 등록 요청 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideUserProductRegistrationService(@NormalRetrofit retrofit: Retrofit): ProductRegistrationService = | ||
retrofit.create(ProductRegistrationService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideUserProductRegistrationRepository(service: ProductRegistrationService): ProductRegistrationRepository = | ||
ProductRegistrationRepository(service) | ||
|
||
// 상품 카테고리 요청 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductCategoryService(@NormalRetrofit retrofit: Retrofit): ProductCategoryService = | ||
retrofit.create(ProductCategoryService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductCategoryRepository(service: ProductCategoryService): ProductCategoryRepository = | ||
ProductCategoryRepository(service) | ||
|
||
// 상품 리스트 요청 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductListService(@NormalRetrofit retrofit: Retrofit): ProductListService = | ||
retrofit.create(ProductListService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductListRepository(service: ProductListService): ProductListRepository = | ||
ProductListRepository(service) | ||
|
||
// 상품 상세 정보, 입찰 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductDetailService(@NormalRetrofit retrofit: Retrofit): ProductDetailService = | ||
retrofit.create(ProductDetailService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductDetailRepository(service: ProductDetailService): ProductDetailRepository = | ||
ProductDetailRepository(service) | ||
|
||
// 스트림 유저 토큰 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideChatService(@NormalRetrofit retrofit: Retrofit): ChatService = | ||
retrofit.create(ChatService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideChatRepository(service: ChatService): ChatRepository = | ||
ChatRepository(service) | ||
|
||
// 인기 검색어 요청 | ||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductSearchService(@NormalRetrofit retrofit: Retrofit): ProductSearchService = | ||
retrofit.create(ProductSearchService::class.java) | ||
|
||
@ActivityRetainedScoped | ||
@Provides | ||
fun provideProductSearchRepository(service: ProductSearchService): ProductSearchRepository = | ||
ProductSearchRepository(service) | ||
} |
15 changes: 15 additions & 0 deletions
15
app/src/main/kotlin/com/fakedevelopers/bidderbidder/ui/LoginActivity.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,15 @@ | ||
package com.fakedevelopers.bidderbidder.ui | ||
|
||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.fakedevelopers.bidderbidder.R | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class LoginActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_login) | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.