лаба 5 (almost done)
This commit is contained in:
4
.idea/deploymentTargetDropDown.xml
generated
4
.idea/deploymentTargetDropDown.xml
generated
@@ -7,11 +7,11 @@
|
|||||||
<deviceKey>
|
<deviceKey>
|
||||||
<Key>
|
<Key>
|
||||||
<type value="VIRTUAL_DEVICE_PATH" />
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
<value value="C:\Users\Huawei\.android\avd\Pixel_3a_API_34_extension_level_7_x86_64.avd" />
|
<value value="C:\Users\Huawei\.android\avd\Virtual_Android.avd" />
|
||||||
</Key>
|
</Key>
|
||||||
</deviceKey>
|
</deviceKey>
|
||||||
</Target>
|
</Target>
|
||||||
</targetSelectedWithDropDown>
|
</targetSelectedWithDropDown>
|
||||||
<timeTargetWasSelectedWithDropDown value="2023-12-06T20:59:46.234342400Z" />
|
<timeTargetWasSelectedWithDropDown value="2023-12-27T18:07:26.006866Z" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -37,7 +37,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@GET("rarities/{id}")
|
@GET("rarities/{id}")
|
||||||
suspend fun getRarity(
|
suspend fun getRarity(
|
||||||
@Path("id") rarityId: Int,
|
@Path("id") id: Int,
|
||||||
): RarityRemote
|
): RarityRemote
|
||||||
|
|
||||||
@POST("rarities")
|
@POST("rarities")
|
||||||
@@ -47,13 +47,13 @@ interface MyServerService {
|
|||||||
|
|
||||||
@PUT("rarities/{id}")
|
@PUT("rarities/{id}")
|
||||||
suspend fun updateRarity(
|
suspend fun updateRarity(
|
||||||
@Path("id") rarityId: Int,
|
@Path("id") id: Int,
|
||||||
@Body rarity: RarityRemote,
|
@Body rarity: RarityRemote,
|
||||||
): RarityRemote
|
): RarityRemote
|
||||||
|
|
||||||
@DELETE("rarities/{id}")
|
@DELETE("rarities/{id}")
|
||||||
suspend fun deleteRarity(
|
suspend fun deleteRarity(
|
||||||
@Path("id") rarityId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("visions")
|
@GET("visions")
|
||||||
@@ -67,7 +67,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@GET("visions/{id}")
|
@GET("visions/{id}")
|
||||||
suspend fun getVision(
|
suspend fun getVision(
|
||||||
@Path("id") visionId: Int,
|
@Path("id") id: Int,
|
||||||
): VisionRemote
|
): VisionRemote
|
||||||
|
|
||||||
@POST("visions")
|
@POST("visions")
|
||||||
@@ -77,13 +77,13 @@ interface MyServerService {
|
|||||||
|
|
||||||
@PUT("visions/{id}")
|
@PUT("visions/{id}")
|
||||||
suspend fun updateVision(
|
suspend fun updateVision(
|
||||||
@Path("id") visionId: Int,
|
@Path("id") id: Int,
|
||||||
@Body vision: VisionRemote,
|
@Body vision: VisionRemote,
|
||||||
): VisionRemote
|
): VisionRemote
|
||||||
|
|
||||||
@DELETE("visions/{id}")
|
@DELETE("visions/{id}")
|
||||||
suspend fun deleteVision(
|
suspend fun deleteVision(
|
||||||
@Path("id") visionId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("weapons")
|
@GET("weapons")
|
||||||
@@ -97,7 +97,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@GET("weapons/{id}")
|
@GET("weapons/{id}")
|
||||||
suspend fun getWeapon(
|
suspend fun getWeapon(
|
||||||
@Path("id") weaponId: Int,
|
@Path("id") id: Int,
|
||||||
): WeaponRemote
|
): WeaponRemote
|
||||||
|
|
||||||
@POST("weapons")
|
@POST("weapons")
|
||||||
@@ -107,13 +107,13 @@ interface MyServerService {
|
|||||||
|
|
||||||
@PUT("weapons/{id}")
|
@PUT("weapons/{id}")
|
||||||
suspend fun updateWeapon(
|
suspend fun updateWeapon(
|
||||||
@Path("id") weaponId: Int,
|
@Path("id") id: Int,
|
||||||
@Body weapon: WeaponRemote,
|
@Body weapon: WeaponRemote,
|
||||||
): WeaponRemote
|
): WeaponRemote
|
||||||
|
|
||||||
@DELETE("weapons/{id}")
|
@DELETE("weapons/{id}")
|
||||||
suspend fun deleteWeapon(
|
suspend fun deleteWeapon(
|
||||||
@Path("id") weaponId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("characters")
|
@GET("characters")
|
||||||
@@ -124,7 +124,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@GET("characters/{id}")
|
@GET("characters/{id}")
|
||||||
suspend fun getCharacter(
|
suspend fun getCharacter(
|
||||||
@Path("id") characterId: Int?,
|
@Path("id") id: Int?,
|
||||||
): CharacterRemote
|
): CharacterRemote
|
||||||
|
|
||||||
@POST("characters")
|
@POST("characters")
|
||||||
@@ -132,21 +132,21 @@ interface MyServerService {
|
|||||||
@Body character: CharacterRemote,
|
@Body character: CharacterRemote,
|
||||||
): CharacterRemote
|
): CharacterRemote
|
||||||
|
|
||||||
@PUT("characters/{id}/{userId}")
|
@PUT("characters/{id}")
|
||||||
suspend fun updateCharacter(
|
suspend fun updateCharacter(
|
||||||
@Path("id") characterId: Int,
|
@Path("id") id: Int,
|
||||||
@Path("userId") userId: Int?,
|
@Query("userId") userId: Int?,
|
||||||
@Body character: CharacterRemote,
|
@Body character: CharacterRemote,
|
||||||
): CharacterRemote
|
): CharacterRemote
|
||||||
|
|
||||||
@DELETE("characters/{id}")
|
@DELETE("characters/{id}")
|
||||||
suspend fun deleteCharacter(
|
suspend fun deleteCharacter(
|
||||||
@Path("id") characterId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("characters/{id}/characterRarities")
|
@GET("characterRarities")
|
||||||
suspend fun getCharacterRarities(
|
suspend fun getCharacterRarities(
|
||||||
@Path("id") characterId: Int?,
|
@Query("id") uid: Int?,
|
||||||
) : List<RarityRemote>
|
) : List<RarityRemote>
|
||||||
|
|
||||||
@POST("characterRarities")
|
@POST("characterRarities")
|
||||||
@@ -156,12 +156,12 @@ interface MyServerService {
|
|||||||
|
|
||||||
@DELETE("characterRarities/{id}")
|
@DELETE("characterRarities/{id}")
|
||||||
suspend fun deleteCharacterRarity(
|
suspend fun deleteCharacterRarity(
|
||||||
@Path("id") characterId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("characters/{id}/characterVisions")
|
@GET("characterVisions")
|
||||||
suspend fun getCharacterVisions(
|
suspend fun getCharacterVisions(
|
||||||
@Path("id") characterId: Int?,
|
@Query("id") uid: Int?,
|
||||||
) : List<VisionRemote>
|
) : List<VisionRemote>
|
||||||
|
|
||||||
@POST("characterVisions")
|
@POST("characterVisions")
|
||||||
@@ -171,12 +171,12 @@ interface MyServerService {
|
|||||||
|
|
||||||
@DELETE("characterVisions/{id}")
|
@DELETE("characterVisions/{id}")
|
||||||
suspend fun deleteCharacterVision(
|
suspend fun deleteCharacterVision(
|
||||||
@Path("id") characterId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
@GET("characters/{id}/characterWeapons")
|
@GET("characterWeapons")
|
||||||
suspend fun getCharacterWeapons(
|
suspend fun getCharacterWeapons(
|
||||||
@Path("id") characterId: Int?,
|
@Query("id") uid: Int?,
|
||||||
) : List<WeaponRemote>
|
) : List<WeaponRemote>
|
||||||
|
|
||||||
@POST("characterWeapons")
|
@POST("characterWeapons")
|
||||||
@@ -186,7 +186,7 @@ interface MyServerService {
|
|||||||
|
|
||||||
@DELETE("characterWeapons/{id}")
|
@DELETE("characterWeapons/{id}")
|
||||||
suspend fun deleteCharacterWeapon(
|
suspend fun deleteCharacterWeapon(
|
||||||
@Path("id") characterId: Int,
|
@Path("id") id: Int,
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class CharacterRemote (
|
data class CharacterRemote (
|
||||||
val characterId: Int = 0,
|
val id: Int = 0,
|
||||||
val characterName: String = "",
|
val characterName: String = "",
|
||||||
val userId: Int? = 0,
|
val userId: Int? = 0,
|
||||||
val image: ByteArray? = null
|
val image: ByteArray? = null
|
||||||
)
|
)
|
||||||
|
|
||||||
fun CharacterRemote.toCharacter(): Character = Character(
|
fun CharacterRemote.toCharacter(): Character = Character(
|
||||||
characterId,
|
id,
|
||||||
characterName,
|
characterName,
|
||||||
userId,
|
userId,
|
||||||
image
|
image
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class RarityRemote (
|
data class RarityRemote (
|
||||||
val rarityId: Int = 0,
|
val id: Int = 0,
|
||||||
val rarityName: String = ""
|
val rarityName: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
fun RarityRemote.toRarity(): Rarity = Rarity(
|
fun RarityRemote.toRarity(): Rarity = Rarity(
|
||||||
rarityId,
|
id,
|
||||||
rarityName
|
rarityName
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class VisionRemote (
|
data class VisionRemote (
|
||||||
val visionId: Int = 0,
|
val id: Int = 0,
|
||||||
val visionName: String = ""
|
val visionName: String = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
fun VisionRemote.toVision(): Vision = Vision(
|
fun VisionRemote.toVision(): Vision = Vision(
|
||||||
visionId,
|
id,
|
||||||
visionName
|
visionName
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class WeaponRemote (
|
data class WeaponRemote (
|
||||||
val weaponId: Int = 0,
|
val id: Int = 0,
|
||||||
val weaponName: String = "",
|
val weaponName: String = "",
|
||||||
val weaponType: String = "",
|
val weaponType: String = "",
|
||||||
val weaponDamage: Int = 0,
|
val weaponDamage: Int = 0,
|
||||||
@@ -13,7 +13,7 @@ data class WeaponRemote (
|
|||||||
)
|
)
|
||||||
|
|
||||||
fun WeaponRemote.toWeapon(): Weapon = Weapon(
|
fun WeaponRemote.toWeapon(): Weapon = Weapon(
|
||||||
weaponId,
|
id,
|
||||||
weaponName,
|
weaponName,
|
||||||
weaponType,
|
weaponType,
|
||||||
weaponDamage,
|
weaponDamage,
|
||||||
|
|||||||
@@ -34681,7 +34681,19 @@
|
|||||||
"password": "password1"
|
"password": "password1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"characterRarities": [],
|
"characterRarities": [
|
||||||
"characterVisions": [],
|
{
|
||||||
|
"characterId": 1,
|
||||||
|
"rarityId": 3,
|
||||||
|
"id": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"characterVisions": [
|
||||||
|
{
|
||||||
|
"characterId": 1,
|
||||||
|
"visionId": 1,
|
||||||
|
"id": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
"characterWeapons": []
|
"characterWeapons": []
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user