cleanup: delete MatchLocalDataSource.kt

This commit is contained in:
Leonardo Murça 2025-07-19 17:55:40 -03:00
parent ff112ce890
commit bf63494b93
2 changed files with 1 additions and 166 deletions

View file

@ -1,159 +0,0 @@
package xyz.leomurca.csgomatches.data.local
import xyz.leomurca.csgomatches.data.model.LeagueDto
import xyz.leomurca.csgomatches.data.model.MatchDto
import xyz.leomurca.csgomatches.data.model.OpponentDto
import xyz.leomurca.csgomatches.data.model.OpponentRecord
import xyz.leomurca.csgomatches.data.model.SerieDto
import xyz.leomurca.csgomatches.data.model.TeamDetailsDto
import xyz.leomurca.csgomatches.data.source.MatchDataSource
import xyz.leomurca.csgomatches.domain.model.Resource
class MatchLocalDataSource : MatchDataSource {
override suspend fun upcomingMatches(page: Int): Resource<List<MatchDto>> {
return Resource.Success(
data = listOf(
// Happy path
MatchDto(
beginAt = null,
opponents = listOf(
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "GenOne",
imageUrl = "https://cdn.pandascore.co/images/team/image/128519/genone_csgo.png"
)
),
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 134996,
name = "VOLT",
imageUrl = "https://cdn.pandascore.co/images/team/image/134996/127px_volt_2024_allmode.png"
)
)
),
league = LeagueDto(
id = 5078,
name = "United21",
imageUrl = "https://cdn.pandascore.co/images/league/image/5078/800px-united21_allmode-png"
),
serie = SerieDto(
id = 9519,
fullName = "Season 35 2025"
),
status = "not_started"
),
// Empty Opponents
MatchDto(
beginAt = null,
opponents = emptyList(),
league = LeagueDto(
id = 5078,
name = "United21",
imageUrl = "https://cdn.pandascore.co/images/league/image/5078/800px-united21_allmode-png"
),
serie = SerieDto(
id = 9519,
fullName = "Season 35 2025"
),
status = "not_started"
),
// Only 1 opponent
MatchDto(
beginAt = null,
opponents = listOf(
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "Bushido Wildcats",
imageUrl = "https://cdn.pandascore.co/images/team/image/136934/bushido_wildcatslogo_square.png"
)
),
),
league = LeagueDto(
id = 5078,
name = "Gamers Club Liga Série A",
imageUrl = "https://cdn.pandascore.co/images/league/image/4554/Liga_Gamers_Club_SSrie_A_logo.png"
),
serie = SerieDto(
id = 9519,
fullName = "July 2025"
),
status = "not_started"
),
// 1 opponent without logo
MatchDto(
beginAt = null,
opponents = listOf(
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "NO ORG",
imageUrl = null
)
),
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "Bushido Wildcats",
imageUrl = "https://cdn.pandascore.co/images/team/image/136934/bushido_wildcatslogo_square.png"
)
),
),
league = LeagueDto(
id = 5078,
name = "Gamers Club Liga Série A",
imageUrl = "https://cdn.pandascore.co/images/league/image/4554/Liga_Gamers_Club_SSrie_A_logo.png"
),
serie = SerieDto(
id = 9519,
fullName = "July 2025"
),
status = "not_started"
),
// League without logo
MatchDto(
beginAt = null,
opponents = listOf(
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "Abyss team",
imageUrl = "https://cdn.pandascore.co/images/team/image/136868/146px_abyss_team_lightmode.png"
)
),
OpponentDto(
type = "team",
opponent = OpponentRecord(
id = 128519,
name = "Bushido Wildcats",
imageUrl = "https://cdn.pandascore.co/images/team/image/136934/bushido_wildcatslogo_square.png"
)
),
),
league = LeagueDto(
id = 5078,
name = "ESEA",
imageUrl = null
),
serie = SerieDto(
id = 9519,
fullName = "July 2025"
),
status = "not_started"
),
)
)
}
override suspend fun teamDetails(teamId: String): Resource<List<TeamDetailsDto>> {
TODO("Not yet implemented")
}
}

View file

@ -14,7 +14,6 @@ import javax.inject.Singleton
import okhttp3.MediaType.Companion.toMediaType import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import xyz.leomurca.csgomatches.BuildConfig import xyz.leomurca.csgomatches.BuildConfig
import xyz.leomurca.csgomatches.data.local.MatchLocalDataSource
import xyz.leomurca.csgomatches.data.remote.AuthorizationInterceptor import xyz.leomurca.csgomatches.data.remote.AuthorizationInterceptor
import xyz.leomurca.csgomatches.data.remote.MatchRemoteDataSourceImpl import xyz.leomurca.csgomatches.data.remote.MatchRemoteDataSourceImpl
import xyz.leomurca.csgomatches.data.repository.MatchRepositoryImpl import xyz.leomurca.csgomatches.data.repository.MatchRepositoryImpl
@ -70,12 +69,7 @@ internal object NetworkModule {
matchesApiService: MatchesApiService, matchesApiService: MatchesApiService,
json: Json json: Json
): MatchDataSource { ): MatchDataSource {
val useRemote = true return MatchRemoteDataSourceImpl(matchesApiService, json)
return if (useRemote) {
MatchRemoteDataSourceImpl(matchesApiService, json)
} else {
MatchLocalDataSource()
}
} }
@Provides @Provides