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