### feat: erweitere ZNS und SQLDelight-Integration
Desktop CI — Headless Tests & Build / Compose Desktop — Tests (headless) & Build (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Has been cancelled
Desktop CI — Headless Tests & Build / Compose Desktop — Tests (headless) & Build (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Has been cancelled
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Has been cancelled
- **SQLDelight:** Füge neue Queries (`countVereine`, `maxUpdated...`) zur SQLite-Datenbank hinzu und aktualisiere `DesktopMasterdataRepository`. - **ZNS-Sync:** Passe `ZnsImportState` an, um Pferde- und Funktionärsdaten zu unterstützen. - **Cloud-Sync:** Entferne redundante Auth-Header und setze Limits für Massensynchronisation auf 50.000 Datensätze. - **Masterdata-Service:** Stabilisiere Consul Health-Checks und implementiere Limit-Beschränkungen auf Controller-Ebene.
This commit is contained in:
+15
-6
@@ -1,18 +1,24 @@
|
||||
package at.mocode.frontend.features.funktionaer.data
|
||||
|
||||
import at.mocode.frontend.core.network.ApiRoutes
|
||||
import at.mocode.frontend.features.funktionaer.domain.Funktionaer
|
||||
import at.mocode.frontend.features.funktionaer.domain.FunktionaerRepository
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.call.*
|
||||
import io.ktor.client.request.*
|
||||
import io.ktor.http.*
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
|
||||
class KtorFunktionaerRepository(private val client: HttpClient) : FunktionaerRepository {
|
||||
override fun getFunktionaere(): Flow<List<Funktionaer>> = flow {
|
||||
try {
|
||||
val response: List<Funktionaer> = client.get("/api/v1/masterdata/funktionaere").body()
|
||||
emit(response)
|
||||
val response = client.get(ApiRoutes.Masterdata.FUNKTIONAERE)
|
||||
if (response.status.isSuccess()) {
|
||||
emit(response.body())
|
||||
} else {
|
||||
emit(emptyList())
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
emit(emptyList())
|
||||
}
|
||||
@@ -20,9 +26,10 @@ class KtorFunktionaerRepository(private val client: HttpClient) : FunktionaerRep
|
||||
|
||||
override suspend fun searchFunktionaere(query: String): List<Funktionaer> {
|
||||
return try {
|
||||
client.get("/api/v1/masterdata/funktionaere/search") {
|
||||
val response = client.get("${ApiRoutes.Masterdata.FUNKTIONAERE}/search") {
|
||||
parameter("q", query)
|
||||
}.body()
|
||||
}
|
||||
if (response.status.isSuccess()) response.body() else emptyList()
|
||||
} catch (_: Exception) {
|
||||
emptyList()
|
||||
}
|
||||
@@ -30,14 +37,16 @@ class KtorFunktionaerRepository(private val client: HttpClient) : FunktionaerRep
|
||||
|
||||
override suspend fun getFunktionaerById(id: Long): Funktionaer? {
|
||||
return try {
|
||||
client.get("/api/v1/masterdata/funktionaere/$id").body()
|
||||
val response = client.get("${ApiRoutes.Masterdata.FUNKTIONAERE}/$id")
|
||||
if (response.status.isSuccess()) response.body() else null
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun saveFunktionaer(funktionaer: Funktionaer) {
|
||||
client.post("/api/v1/masterdata/funktionaere") {
|
||||
client.post(ApiRoutes.Masterdata.FUNKTIONAERE) {
|
||||
contentType(ContentType.Application.Json)
|
||||
setBody(funktionaer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user