mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Modularize more models/utils (#3182)
This commit is contained in:
parent
5bb3f73e0d
commit
4eba3e9daf
80 changed files with 656 additions and 629 deletions
|
|
@ -23,9 +23,9 @@ import dagger.hilt.InstallIn
|
|||
import dagger.hilt.components.SingletonComponent
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import org.meshtastic.core.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.model.NetworkFirmwareReleases
|
||||
import org.meshtastic.core.network.BuildConfig
|
||||
import org.meshtastic.core.network.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.network.model.NetworkFirmwareReleases
|
||||
import org.meshtastic.core.network.service.ApiService
|
||||
import javax.inject.Singleton
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.meshtastic.core.network
|
|||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.meshtastic.core.network.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.network.service.ApiService
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.meshtastic.core.network
|
|||
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.meshtastic.core.network.model.NetworkFirmwareReleases
|
||||
import org.meshtastic.core.model.NetworkFirmwareReleases
|
||||
import org.meshtastic.core.network.service.ApiService
|
||||
import javax.inject.Inject
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
*
|
||||
* 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 org.meshtastic.core.network.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class NetworkDeviceHardware(
|
||||
@SerialName("activelySupported") val activelySupported: Boolean = false,
|
||||
@SerialName("architecture") val architecture: String = "",
|
||||
@SerialName("displayName") val displayName: String = "",
|
||||
@SerialName("hasInkHud") val hasInkHud: Boolean? = null,
|
||||
@SerialName("hasMui") val hasMui: Boolean? = null,
|
||||
@SerialName("hwModel") val hwModel: Int = 0,
|
||||
@SerialName("hwModelSlug") val hwModelSlug: String = "",
|
||||
@SerialName("images") val images: List<String>? = null,
|
||||
@SerialName("partitionScheme") val partitionScheme: String? = null,
|
||||
@SerialName("platformioTarget") val platformioTarget: String = "",
|
||||
@SerialName("requiresDfu") val requiresDfu: Boolean? = null,
|
||||
@SerialName("supportLevel") val supportLevel: Int? = null,
|
||||
@SerialName("tags") val tags: List<String>? = null,
|
||||
)
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
*
|
||||
* 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 org.meshtastic.core.network.model
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class NetworkFirmwareRelease(
|
||||
@SerialName("id") val id: String = "",
|
||||
@SerialName("page_url") val pageUrl: String = "",
|
||||
@SerialName("release_notes") val releaseNotes: String = "",
|
||||
@SerialName("title") val title: String = "",
|
||||
@SerialName("zip_url") val zipUrl: String = "",
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Releases(
|
||||
@SerialName("alpha") val alpha: List<NetworkFirmwareRelease> = listOf(),
|
||||
@SerialName("stable") val stable: List<NetworkFirmwareRelease> = listOf(),
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class NetworkFirmwareReleases(
|
||||
@SerialName("pullRequests") val pullRequests: List<NetworkFirmwareRelease> = listOf(),
|
||||
@SerialName("releases") val releases: Releases = Releases(),
|
||||
)
|
||||
|
|
@ -18,8 +18,8 @@
|
|||
package org.meshtastic.core.network.service
|
||||
|
||||
import de.jensklingenberg.ktorfit.http.GET
|
||||
import org.meshtastic.core.network.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.network.model.NetworkFirmwareReleases
|
||||
import org.meshtastic.core.model.NetworkDeviceHardware
|
||||
import org.meshtastic.core.model.NetworkFirmwareReleases
|
||||
|
||||
interface ApiService {
|
||||
@GET("resource/deviceHardware")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue