не знаю
This commit is contained in:
parent
c8f8b59672
commit
d35ee4907d
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="deploymentTargetDropDown">
|
|
||||||
<runningDeviceTargetSelectedWithDropDown>
|
|
||||||
<Target>
|
|
||||||
<type value="RUNNING_DEVICE_TARGET" />
|
|
||||||
<deviceKey>
|
|
||||||
<Key>
|
|
||||||
<type value="SERIAL_NUMBER" />
|
|
||||||
<value value="KFRSEQ6DTWWWQOE6" />
|
|
||||||
</Key>
|
|
||||||
</deviceKey>
|
|
||||||
</Target>
|
|
||||||
</runningDeviceTargetSelectedWithDropDown>
|
|
||||||
<timeTargetWasSelectedWithDropDown value="2023-12-24T13:45:26.698560500Z" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -151,7 +151,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@POST("orders")
|
@POST("orders")
|
||||||
suspend fun createOrder(
|
suspend fun createOrder(
|
||||||
@Body cinema: OrderRemote,
|
@Body order: OrderRemote,
|
||||||
): OrderRemote
|
): OrderRemote
|
||||||
|
|
||||||
@PUT("orders/{id}")
|
@PUT("orders/{id}")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.myapplication.api.cinema
|
package com.example.myapplication.api.cinema
|
||||||
|
|
||||||
import com.example.myapplication.database.entities.model.Cinema
|
import com.example.myapplication.database.entities.model.Cinema
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.example.myapplication.api.cinema
|
package com.example.myapplication.api.cinema
|
||||||
|
|
||||||
import com.example.myapplication.api.session.SessionFromCinemaRemote
|
import com.example.myapplication.api.session.SessionFromCinemaRemote
|
||||||
import com.example.myapplication.api.session.toSessionFromCinema
|
|
||||||
import com.example.myapplication.database.entities.model.Cinema
|
import com.example.myapplication.database.entities.model.Cinema
|
||||||
import com.example.myapplication.database.entities.model.Session
|
|
||||||
import com.example.myapplication.database.entities.model.toSession
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@ -27,5 +24,3 @@ fun CinemaWithSessionsRemote.toCinema(): Cinema = Cinema(
|
|||||||
year
|
year
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CinemaWithSessionsRemote.toSessions(): List<Session> =
|
|
||||||
sessions.map { it.toSessionFromCinema().toSession() }
|
|
@ -6,12 +6,10 @@ import androidx.room.TypeConverter
|
|||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
import com.example.myapplication.database.entities.model.Cinema
|
import com.example.myapplication.database.entities.model.Cinema
|
||||||
import com.example.myapplication.database.entities.model.Order
|
import com.example.myapplication.database.entities.model.Order
|
||||||
import com.example.myapplication.database.entities.model.Session
|
|
||||||
|
|
||||||
enum class RemoteKeyType(private val type: String) {
|
enum class RemoteKeyType(private val type: String) {
|
||||||
CINEMA(Cinema::class.simpleName ?: "Cinema"),
|
CINEMA(Cinema::class.simpleName ?: "Cinema"),
|
||||||
ORDER(Order::class.simpleName ?: "Order"),
|
ORDER(Order::class.simpleName ?: "Order");
|
||||||
SESSION(Session::class.simpleName ?: "Session");
|
|
||||||
|
|
||||||
@TypeConverter
|
@TypeConverter
|
||||||
fun toRemoteKeyType(value: String) = RemoteKeyType.values().first { it.type == value }
|
fun toRemoteKeyType(value: String) = RemoteKeyType.values().first { it.type == value }
|
||||||
|
Loading…
Reference in New Issue
Block a user