fix: fixed schedules not being deserialized correctly
Some checks failed
Build Gradle project / build-gradle-project (push) Has been cancelled

Signed-off-by: moonleay <contact@moonleay.net>
This commit is contained in:
moonleay 2024-01-29 16:40:38 +01:00
parent d0ae43e420
commit 95321b4895
Signed by: moonleay
GPG key ID: 82667543CCD715FB
5 changed files with 103 additions and 3 deletions

View file

@ -0,0 +1,29 @@
/*
* lilJudd
* Copyright (C) 2024 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class BannerImage(
@SerialName("url")
val url: String,
)

View file

@ -25,7 +25,7 @@ import kotlinx.serialization.Serializable
@Serializable
data class CoopGroupingSchedule(
@SerialName("bannerImage")
val bannerImage: String?, // is null
val bannerImage: BannerImage?, // is null
@SerialName("bigRunSchedules")
val bigRunSchedules: BigRunSchedules,
@SerialName("regularSchedules")

View file

@ -0,0 +1,39 @@
/*
* lilJudd
* Copyright (C) 2024 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class CoopSetting(
@SerialName("boss")
val boss: String?, // Not really String, but idk
@SerialName("coopStage")
val coopStage: CoopStage,
@SerialName("__isCoopSetting")
val isCoopSetting: String,
@SerialName("rule")
val rule: String,
@SerialName("__typename")
val typename: String,
@SerialName("weapons")
val weapons: List<Weapon>
)

View file

@ -0,0 +1,33 @@
/*
* lilJudd
* Copyright (C) 2024 moonleay
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.moonleay.lilJudd.data.api.splatoon3ink.schedules
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class TeamContestNode(
@SerialName("endTime")
val endTime: String,
@SerialName("setting")
val setting: CoopSetting,
@SerialName("startTime")
val startTime: String
)

View file

@ -23,8 +23,7 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
// TODO: Please check what goes here.
data class TeamContestSchedules(
@SerialName("nodes")
val nodes: List<Int> // This is a placeholder.
val nodes: List<TeamContestNode> // This is a placeholder.
)