mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
refactor(extension/repo): Refactor the ExtensionRepoService to use DTOs
Co-authored-by: MajorTanya <39014446+MajorTanya@users.noreply.github.com>
This commit is contained in:
parent
c7405e0b33
commit
da99cf5cfa
10 changed files with 43 additions and 61 deletions
|
@ -5,6 +5,7 @@ import java.util.Locale
|
|||
import yokai.domain.manga.models.MangaUpdate
|
||||
|
||||
// TODO: Transform into data class
|
||||
@Deprecated("Use data class version", ReplaceWith("yokai.domain.manga.models.Manga"))
|
||||
interface Manga : SManga {
|
||||
|
||||
var id: Long?
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package yokai.domain.extension.repo.model
|
||||
|
||||
data class ExtensionRepo(
|
||||
val baseUrl: String,
|
||||
val name: String,
|
||||
val shortName: String?,
|
||||
val website: String,
|
||||
val signingKeyFingerprint: String,
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
package yokai.domain.extension.repo.service
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
import yokai.domain.extension.repo.model.ExtensionRepo
|
||||
|
||||
@Serializable
|
||||
data class ExtensionRepoMetaDto(
|
||||
val meta: ExtensionRepoDto,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ExtensionRepoDto(
|
||||
val name: String,
|
||||
val shortName: String?,
|
||||
val website: String,
|
||||
val signingKeyFingerprint: String,
|
||||
)
|
||||
|
||||
fun ExtensionRepoMetaDto.toExtensionRepo(baseUrl: String): ExtensionRepo {
|
||||
return ExtensionRepo(
|
||||
baseUrl = baseUrl,
|
||||
name = meta.name,
|
||||
shortName = meta.shortName,
|
||||
website = meta.website,
|
||||
signingKeyFingerprint = meta.signingKeyFingerprint,
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue