mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
[API] Partially revert "Include device object in each request."
This commit is contained in:
parent
3ba30ede92
commit
97e0d04842
@ -57,7 +57,7 @@ class SzkolnyApi(val app: App) {
|
||||
|
||||
private fun getDevice() = run {
|
||||
val config = app.config
|
||||
val device = ApiRequest.Device(
|
||||
val device = Device(
|
||||
osType = "Android",
|
||||
osVersion = Build.VERSION.RELEASE,
|
||||
hardware = "${Build.MANUFACTURER} ${Build.MODEL}",
|
||||
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Kuba Szczodrzyński 2020-1-20.
|
||||
*/
|
||||
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
open class ApiRequest(
|
||||
open val deviceId: String,
|
||||
open val device: Device? = null
|
||||
) {
|
||||
data class Device(
|
||||
val osType: String,
|
||||
val osVersion: String,
|
||||
val hardware: String,
|
||||
val pushToken: String?,
|
||||
val appVersion: String,
|
||||
val appType: String,
|
||||
val appVersionCode: Int,
|
||||
val syncInterval: Int
|
||||
)
|
||||
}
|
@ -5,9 +5,9 @@
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
data class AppUserRequest(
|
||||
override val deviceId: String,
|
||||
override val device: Device? = null,
|
||||
val deviceId: String,
|
||||
val device: Device? = null,
|
||||
|
||||
val action: String = "unregister",
|
||||
val userCode: String
|
||||
) : ApiRequest(deviceId, device)
|
||||
)
|
||||
|
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (c) Kuba Szczodrzyński 2020-1-20.
|
||||
*/
|
||||
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
data class Device(
|
||||
val osType: String,
|
||||
val osVersion: String,
|
||||
val hardware: String,
|
||||
val pushToken: String?,
|
||||
val appVersion: String,
|
||||
val appType: String,
|
||||
val appVersionCode: Int,
|
||||
val syncInterval: Int
|
||||
)
|
@ -5,12 +5,12 @@
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
data class ErrorReportRequest(
|
||||
override val deviceId: String,
|
||||
override val device: Device? = null,
|
||||
val deviceId: String,
|
||||
val device: Device? = null,
|
||||
|
||||
val appVersion: String,
|
||||
val errors: List<Error>
|
||||
) : ApiRequest(deviceId, device) {
|
||||
) {
|
||||
data class Error(
|
||||
val id: Long,
|
||||
val tag: String,
|
||||
|
@ -7,8 +7,8 @@ package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
||||
|
||||
data class EventShareRequest (
|
||||
override val deviceId: String,
|
||||
override val device: Device? = null,
|
||||
val deviceId: String,
|
||||
val device: Device? = null,
|
||||
|
||||
val action: String = "event",
|
||||
|
||||
@ -19,4 +19,4 @@ data class EventShareRequest (
|
||||
|
||||
val eventId: Long? = null,
|
||||
val event: EventFull? = null
|
||||
) : ApiRequest(deviceId, device)
|
||||
)
|
||||
|
@ -5,14 +5,14 @@
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
data class ServerSyncRequest(
|
||||
override val deviceId: String,
|
||||
override val device: Device? = null,
|
||||
val deviceId: String,
|
||||
val device: Device? = null,
|
||||
|
||||
val userCodes: List<String>,
|
||||
val users: List<User>? = null,
|
||||
|
||||
val notifications: List<Notification>? = null
|
||||
) : ApiRequest(deviceId, device) {
|
||||
) {
|
||||
data class User(
|
||||
val userCode: String,
|
||||
val studentName: String,
|
||||
|
@ -5,11 +5,11 @@
|
||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||
|
||||
data class WebPushRequest(
|
||||
override val deviceId: String,
|
||||
override val device: Device? = null,
|
||||
val deviceId: String,
|
||||
val device: Device? = null,
|
||||
|
||||
val action: String,
|
||||
|
||||
val browserId: String? = null,
|
||||
val pairToken: String? = null
|
||||
) : ApiRequest(deviceId, device)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user