Skip to content

Commit 9b300ef

Browse files
committed
Remove unused code
1 parent e11e39b commit 9b300ef

13 files changed

Lines changed: 1 addition & 1102 deletions

File tree

app/src/main/kotlin/api/Api.kt

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package api
22

3-
import area_element.AreaElementJson
4-
import area_element.toAreaElementsJson
53
import element.Element
64
import element.toElements
75
import element_comment.ElementCommentJson
@@ -16,8 +14,6 @@ import okhttp3.OkHttpClient
1614
import okhttp3.Request
1715
import okhttp3.brotli.BrotliInterceptor
1816
import okhttp3.coroutines.executeAsync
19-
import reports.ReportJson
20-
import reports.toReportsJson
2117
import user.UserJson
2218
import user.toUsersJson
2319
import java.time.ZonedDateTime
@@ -35,11 +31,7 @@ interface Api {
3531

3632
suspend fun getEvents(): List<Event>
3733

38-
suspend fun getReports(updatedSince: ZonedDateTime?, limit: Long): List<ReportJson>
39-
4034
suspend fun getUsers(updatedSince: ZonedDateTime?, limit: Long): List<UserJson>
41-
42-
suspend fun getAreaElements(updatedSince: ZonedDateTime?, limit: Long): List<AreaElementJson>
4335
}
4436

4537
class ApiImpl(
@@ -124,25 +116,6 @@ class ApiImpl(
124116
}
125117
}
126118

127-
override suspend fun getReports(updatedSince: ZonedDateTime?, limit: Long): List<ReportJson> {
128-
val url = baseUrl.newBuilder().apply {
129-
addPathSegment("v3")
130-
addPathSegment("reports")
131-
addQueryParameter("updated_since", updatedSince.apiFormat())
132-
addQueryParameter("limit", "$limit")
133-
}.build()
134-
135-
val res = httpClient.newCall(Request.Builder().url(url).build()).executeAsync()
136-
137-
if (!res.isSuccessful) {
138-
throw Exception("Unexpected HTTP response code: ${res.code}")
139-
}
140-
141-
return withContext(Dispatchers.IO) {
142-
res.body.byteStream().use { it.toReportsJson() }
143-
}
144-
}
145-
146119
override suspend fun getUsers(updatedSince: ZonedDateTime?, limit: Long): List<UserJson> {
147120
val url = baseUrl.newBuilder().apply {
148121
addPathSegment("v3")
@@ -161,28 +134,6 @@ class ApiImpl(
161134
res.body.byteStream().use { it.toUsersJson() }
162135
}
163136
}
164-
165-
override suspend fun getAreaElements(
166-
updatedSince: ZonedDateTime?,
167-
limit: Long
168-
): List<AreaElementJson> {
169-
val url = baseUrl.newBuilder().apply {
170-
addPathSegment("v3")
171-
addPathSegment("area-elements")
172-
addQueryParameter("updated_since", updatedSince.apiFormat())
173-
addQueryParameter("limit", "$limit")
174-
}.build()
175-
176-
val res = httpClient.newCall(Request.Builder().url(url).build()).executeAsync()
177-
178-
if (!res.isSuccessful) {
179-
throw Exception("Unexpected HTTP response code: ${res.code}")
180-
}
181-
182-
return withContext(Dispatchers.IO) {
183-
res.body.byteStream().use { it.toAreaElementsJson() }
184-
}
185-
}
186137
}
187138

188139
private fun apiHttpClient(): OkHttpClient {

app/src/main/kotlin/app/AppModule.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import org.koin.androidx.viewmodel.dsl.viewModelOf
1111
import org.koin.core.module.dsl.singleOf
1212
import org.koin.dsl.bind
1313
import org.koin.dsl.module
14-
import reports.ReportQueries
15-
import reports.ReportsModel
16-
import reports.ReportsRepo
1714
import search.SearchModel
1815
import search.SearchResultModel
1916
import sync.Sync
@@ -22,8 +19,6 @@ import user.UsersModel
2219
import user.UsersRepo
2320
import element_comment.ElementCommentQueries
2421
import element_comment.ElementCommentRepo
25-
import area_element.AreaElementQueries
26-
import area_element.AreaElementRepo
2722

2823
val appModule = module {
2924
single { Database(get<Context>().getDatabasePath("btcmap-2025-08-24.db").absolutePath).conn }
@@ -38,13 +33,6 @@ val appModule = module {
3833
singleOf(::ElementCommentQueries)
3934
singleOf(::ElementCommentRepo)
4035

41-
singleOf(::AreaElementQueries)
42-
singleOf(::AreaElementRepo)
43-
44-
singleOf(::ReportQueries)
45-
singleOf(::ReportsRepo)
46-
viewModelOf(::ReportsModel)
47-
4836
singleOf(::UserQueries)
4937
singleOf(::UsersRepo)
5038
viewModelOf(::UsersModel)

app/src/main/kotlin/area_element/AreaElement.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

app/src/main/kotlin/area_element/AreaElementJson.kt

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/src/main/kotlin/area_element/AreaElementQueries.kt

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)