не знаю

This commit is contained in:
dasha 2023-12-25 21:15:57 +04:00
parent c8f8b59672
commit d35ee4907d
5 changed files with 3 additions and 27 deletions

View File

@ -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>

View File

@ -151,7 +151,7 @@ interface MyServerService {
@POST("orders")
suspend fun createOrder(
@Body cinema: OrderRemote,
@Body order: OrderRemote,
): OrderRemote
@PUT("orders/{id}")

View File

@ -1,10 +1,7 @@
package com.example.myapplication.api.cinema
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.Session
import com.example.myapplication.database.entities.model.toSession
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@ -27,5 +24,3 @@ fun CinemaWithSessionsRemote.toCinema(): Cinema = Cinema(
year
)
fun CinemaWithSessionsRemote.toSessions(): List<Session> =
sessions.map { it.toSessionFromCinema().toSession() }

View File

@ -6,12 +6,10 @@ import androidx.room.TypeConverter
import androidx.room.TypeConverters
import com.example.myapplication.database.entities.model.Cinema
import com.example.myapplication.database.entities.model.Order
import com.example.myapplication.database.entities.model.Session
enum class RemoteKeyType(private val type: String) {
CINEMA(Cinema::class.simpleName ?: "Cinema"),
ORDER(Order::class.simpleName ?: "Order"),
SESSION(Session::class.simpleName ?: "Session");
ORDER(Order::class.simpleName ?: "Order");
@TypeConverter
fun toRemoteKeyType(value: String) = RemoteKeyType.values().first { it.type == value }