-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
84 changed files
with
2,184 additions
and
961 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.terning.point.di | ||
|
||
import android.content.Context | ||
import android.content.SharedPreferences | ||
import com.terning.data.local.TerningDataStore | ||
import com.terning.data.local.TerningDataStoreImpl | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object DataStoreModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideSharedPreferences(@ApplicationContext context: Context): SharedPreferences = | ||
context.getSharedPreferences(context.packageName, Context.MODE_PRIVATE) | ||
|
||
@Provides | ||
@Singleton | ||
fun provideTerningDataStore(dataStoreImpl: TerningDataStoreImpl): TerningDataStore = | ||
dataStoreImpl | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.terning.core.extension | ||
|
||
fun<T> List<T>?.isListNotEmpty():Boolean = this.orEmpty().isNotEmpty() |
12 changes: 12 additions & 0 deletions
12
data/src/main/java/com/terning/data/datasource/AuthDataSource.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,12 @@ | ||
package com.terning.data.datasource | ||
|
||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.request.SignInRequestDto | ||
import com.terning.data.dto.response.SignInResponseDto | ||
|
||
interface AuthDataSource { | ||
suspend fun postSignIn( | ||
authorization: String, | ||
platform: SignInRequestDto | ||
): BaseResponse<SignInResponseDto> | ||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/com/terning/data/datasource/CalendarDataSource.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.terning.data.datasource | ||
|
||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.request.CalendarDayListRequestDto | ||
import com.terning.data.dto.request.CalendarMonthListRequestDto | ||
import com.terning.data.dto.request.CalendarMonthRequestDto | ||
import com.terning.data.dto.response.CalendarDayListResponseDto | ||
import com.terning.data.dto.response.CalendarMonthListResponseDto | ||
import com.terning.data.dto.response.CalendarMonthResponseDto | ||
|
||
interface CalendarDataSource { | ||
suspend fun getCalendarMonth(request: CalendarMonthRequestDto): BaseResponse<List<CalendarMonthResponseDto>> | ||
suspend fun getCalendarMonthList(request: CalendarMonthListRequestDto): BaseResponse<List<CalendarMonthListResponseDto>> | ||
suspend fun getCalendarDayList(request: CalendarDayListRequestDto): BaseResponse<List<CalendarDayListResponseDto>> | ||
} |
7 changes: 0 additions & 7 deletions
7
data/src/main/java/com/terning/data/datasource/MockDataSource.kt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
data/src/main/java/com/terning/data/datasource/ScrapDataSource.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
data/src/main/java/com/terning/data/datasource/SearchDataSource.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.terning.data.datasource | ||
|
||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.response.SearchViewsResponseDto | ||
|
||
interface SearchDataSource { | ||
suspend fun getSearchViews(): BaseResponse<SearchViewsResponseDto> | ||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/java/com/terning/data/datasourceimpl/AuthDataSourceImpl.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,17 @@ | ||
package com.terning.data.datasourceimpl | ||
|
||
import com.terning.data.datasource.AuthDataSource | ||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.request.SignInRequestDto | ||
import com.terning.data.dto.response.SignInResponseDto | ||
import com.terning.data.service.AuthService | ||
import javax.inject.Inject | ||
|
||
class AuthDataSourceImpl @Inject constructor( | ||
private val authService: AuthService | ||
) : AuthDataSource { | ||
override suspend fun postSignIn( | ||
authorization: String, | ||
platform: SignInRequestDto | ||
): BaseResponse<SignInResponseDto> = authService.postSignIn(authorization, platform) | ||
} |
25 changes: 25 additions & 0 deletions
25
data/src/main/java/com/terning/data/datasourceimpl/CalendarDataSourceImpl.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,25 @@ | ||
package com.terning.data.datasourceimpl | ||
|
||
import com.terning.data.datasource.CalendarDataSource | ||
import com.terning.data.dto.BaseResponse | ||
import com.terning.data.dto.request.CalendarDayListRequestDto | ||
import com.terning.data.dto.request.CalendarMonthListRequestDto | ||
import com.terning.data.dto.request.CalendarMonthRequestDto | ||
import com.terning.data.dto.response.CalendarDayListResponseDto | ||
import com.terning.data.dto.response.CalendarMonthListResponseDto | ||
import com.terning.data.dto.response.CalendarMonthResponseDto | ||
import com.terning.data.service.CalendarService | ||
import javax.inject.Inject | ||
|
||
class CalendarDataSourceImpl @Inject constructor( | ||
private val calendarService: CalendarService | ||
) : CalendarDataSource { | ||
override suspend fun getCalendarMonth(request: CalendarMonthRequestDto): BaseResponse<List<CalendarMonthResponseDto>> = | ||
CalendarList.getCalendarScrapMonth(request) | ||
|
||
override suspend fun getCalendarMonthList(request: CalendarMonthListRequestDto): BaseResponse<List<CalendarMonthListResponseDto>> = | ||
CalendarList.getCalendarScrapMonthList(request) | ||
|
||
override suspend fun getCalendarDayList(request: CalendarDayListRequestDto): BaseResponse<List<CalendarDayListResponseDto>> = | ||
CalendarList.getCalendarScrapDayList(request) | ||
} |
Oops, something went wrong.