mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-17 19:07:02 +05:30
Revert "all: switch to moshi-kotlin and fix tests"
This reverts commit da25dd2ed9bea50691b889e093ff896fea598b1a. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
f9fcb089a1
commit
32bfdde04e
7 changed files with 11 additions and 10 deletions
|
@ -1,13 +1,14 @@
|
|||
plugins {
|
||||
id("com.android.library")
|
||||
kotlin("android")
|
||||
kotlin("kapt")
|
||||
id("com.squareup.sqldelight")
|
||||
`lobsters-plugin`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt(Dependencies.ThirdParty.Moshi.codegen)
|
||||
implementation(Dependencies.ThirdParty.Moshi.lib)
|
||||
implementation(Dependencies.ThirdParty.Moshi.kotlinReflect)
|
||||
testImplementation(Dependencies.Kotlin.Coroutines.core)
|
||||
testImplementation(Dependencies.ThirdParty.SQLDelight.jvmDriver)
|
||||
testImplementation(Dependencies.Testing.junit)
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package dev.msfjarvis.lobsters.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
class KeybaseSignature(
|
||||
@Json(name = "kb_username")
|
||||
val kbUsername: String,
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package dev.msfjarvis.lobsters.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
class Submitter(
|
||||
val username: String,
|
||||
@Json(name = "created_at")
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package dev.msfjarvis.lobsters.model
|
||||
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
|
||||
import com.squareup.sqldelight.ColumnAdapter
|
||||
|
||||
class SubmitterAdapter : ColumnAdapter<Submitter, String> {
|
||||
private val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
|
||||
private val submitterJsonAdapter = moshi.adapter(Submitter::class.java)
|
||||
private val moshi = Moshi.Builder().build()
|
||||
private val submitterJsonAdapter = SubmitterJsonAdapter(moshi)
|
||||
|
||||
override fun decode(databaseValue: String): Submitter {
|
||||
return submitterJsonAdapter.fromJson(databaseValue)!!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue