mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-19 05:16:56 -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 {
|
private fun getDevice() = run {
|
||||||
val config = app.config
|
val config = app.config
|
||||||
val device = ApiRequest.Device(
|
val device = Device(
|
||||||
osType = "Android",
|
osType = "Android",
|
||||||
osVersion = Build.VERSION.RELEASE,
|
osVersion = Build.VERSION.RELEASE,
|
||||||
hardware = "${Build.MANUFACTURER} ${Build.MODEL}",
|
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
|
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||||
|
|
||||||
data class AppUserRequest(
|
data class AppUserRequest(
|
||||||
override val deviceId: String,
|
val deviceId: String,
|
||||||
override val device: Device? = null,
|
val device: Device? = null,
|
||||||
|
|
||||||
val action: String = "unregister",
|
val action: String = "unregister",
|
||||||
val userCode: String
|
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
|
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||||
|
|
||||||
data class ErrorReportRequest(
|
data class ErrorReportRequest(
|
||||||
override val deviceId: String,
|
val deviceId: String,
|
||||||
override val device: Device? = null,
|
val device: Device? = null,
|
||||||
|
|
||||||
val appVersion: String,
|
val appVersion: String,
|
||||||
val errors: List<Error>
|
val errors: List<Error>
|
||||||
) : ApiRequest(deviceId, device) {
|
) {
|
||||||
data class Error(
|
data class Error(
|
||||||
val id: Long,
|
val id: Long,
|
||||||
val tag: String,
|
val tag: String,
|
||||||
|
@ -7,8 +7,8 @@ package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
|||||||
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
import pl.szczodrzynski.edziennik.data.db.full.EventFull
|
||||||
|
|
||||||
data class EventShareRequest (
|
data class EventShareRequest (
|
||||||
override val deviceId: String,
|
val deviceId: String,
|
||||||
override val device: Device? = null,
|
val device: Device? = null,
|
||||||
|
|
||||||
val action: String = "event",
|
val action: String = "event",
|
||||||
|
|
||||||
@ -19,4 +19,4 @@ data class EventShareRequest (
|
|||||||
|
|
||||||
val eventId: Long? = null,
|
val eventId: Long? = null,
|
||||||
val event: EventFull? = null
|
val event: EventFull? = null
|
||||||
) : ApiRequest(deviceId, device)
|
)
|
||||||
|
@ -5,14 +5,14 @@
|
|||||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||||
|
|
||||||
data class ServerSyncRequest(
|
data class ServerSyncRequest(
|
||||||
override val deviceId: String,
|
val deviceId: String,
|
||||||
override val device: Device? = null,
|
val device: Device? = null,
|
||||||
|
|
||||||
val userCodes: List<String>,
|
val userCodes: List<String>,
|
||||||
val users: List<User>? = null,
|
val users: List<User>? = null,
|
||||||
|
|
||||||
val notifications: List<Notification>? = null
|
val notifications: List<Notification>? = null
|
||||||
) : ApiRequest(deviceId, device) {
|
) {
|
||||||
data class User(
|
data class User(
|
||||||
val userCode: String,
|
val userCode: String,
|
||||||
val studentName: String,
|
val studentName: String,
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
package pl.szczodrzynski.edziennik.data.api.szkolny.request
|
||||||
|
|
||||||
data class WebPushRequest(
|
data class WebPushRequest(
|
||||||
override val deviceId: String,
|
val deviceId: String,
|
||||||
override val device: Device? = null,
|
val device: Device? = null,
|
||||||
|
|
||||||
val action: String,
|
val action: String,
|
||||||
|
|
||||||
val browserId: String? = null,
|
val browserId: String? = null,
|
||||||
val pairToken: String? = null
|
val pairToken: String? = null
|
||||||
) : ApiRequest(deviceId, device)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user