mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-18 03:17:03 +05:30
model: init
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
ee07f8391c
commit
4a363200a0
11 changed files with 30 additions and 13 deletions
1
model/.gitignore
vendored
Normal file
1
model/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/build
|
11
model/build.gradle
Normal file
11
model/build.gradle
Normal file
|
@ -0,0 +1,11 @@
|
|||
plugins {
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def moshi_version = "1.9.3"
|
||||
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
|
||||
implementation "com.squareup.moshi:moshi:$moshi_version"
|
||||
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
|
||||
}
|
5
model/src/main/AndroidManifest.xml
Normal file
5
model/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="dev.msfjarvis.lobsters.model">
|
||||
|
||||
</manifest>
|
|
@ -0,0 +1,12 @@
|
|||
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,
|
||||
@Json(name = "sig_hash")
|
||||
val sigHash: String
|
||||
)
|
|
@ -0,0 +1,26 @@
|
|||
package dev.msfjarvis.lobsters.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
class LobstersPost(
|
||||
@Json(name = "short_id")
|
||||
val shortId: String,
|
||||
@Json(name = "short_id_url")
|
||||
val shortIdUrl: String,
|
||||
@Json(name = "created_at")
|
||||
val createdAt: String,
|
||||
val title: String,
|
||||
val url: String,
|
||||
val score: Long,
|
||||
val flags: Long,
|
||||
@Json(name = "comment_count")
|
||||
val commentCount: Long,
|
||||
val description: String,
|
||||
@Json(name = "comments_url")
|
||||
val commentsUrl: String,
|
||||
@Json(name = "submitter_user")
|
||||
val submitterUser: Submitter,
|
||||
val tags: List<String>
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
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")
|
||||
val createdAt: String,
|
||||
@Json(name = "is_admin")
|
||||
val isAdmin: Boolean,
|
||||
val about: String,
|
||||
@Json(name = "is_moderator")
|
||||
val isModerator: Boolean,
|
||||
val karma: Long,
|
||||
@Json(name = "avatar_url")
|
||||
val avatarUrl: String,
|
||||
@Json(name = "invited_by_user")
|
||||
val invitedByUser: String,
|
||||
@Json(name = "github_username")
|
||||
val githubUsername: String?,
|
||||
@Json(name = "twitter_username")
|
||||
val twitterUsername: String?,
|
||||
@Json(name = "keybase_signatures")
|
||||
val keybaseSignatures: List<KeybaseSignature>?
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue