-
Notifications
You must be signed in to change notification settings - Fork 0
/
feed.kt
41 lines (34 loc) · 1.15 KB
/
feed.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.github.jetbrains.rssreader.core.entity
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlin.js.ExperimentalJsExport
import kotlin.js.JsExport
@Serializable
data class Feed(
@SerialName("title") val title: String,
@SerialName("link") val link: String,
@SerialName("description") val desc: String,
@SerialName("imageUrl") val imageUrl: String?,
@SerialName("posts") val posts: List<Post>,
@SerialName("sourceUrl") val sourceUrl: String,
@SerialName("isDefault") val isDefault: Boolean
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
other as Feed
if (sourceUrl != other.sourceUrl) return false
return true
}
override fun hashCode(): Int {
return sourceUrl.hashCode()
}
}
@Serializable
data class Post(
@SerialName("title") val title: String,
@SerialName("link") val link: String?,
@SerialName("description") val desc: String?,
@SerialName("imageUrl") val imageUrl: String?,
@SerialName("date") val date: Long
)