Files
RSSuper/native-route/android/src/main/java/com/rssuper/models/SearchResult.kt
Michael Freno fdd4fd8a46 feat: implement Android data models in Kotlin
- Add FeedItem, Feed, FeedSubscription models with Moshi JSON support
- Add SearchResult, SearchFilters models with sealed classes for enums
- Add NotificationPreferences, ReadingPreferences models
- Add Room Entity annotations for database readiness
- Add TypeConverters for Date and List<String> serialization
- Add Parcelize for passing models between Activities/Fragments
- Write comprehensive unit tests for serialization/deserialization
- Write tests for copy(), equals/hashCode, and toString functionality
2026-03-29 15:40:38 -04:00

50 lines
1.0 KiB
Kotlin

package com.rssuper.models
import android.os.Parcelable
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import com.rssuper.converters.DateConverter
import kotlinx.parcelize.Parcelize
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.util.Date
@JsonClass(generateAdapter = true)
@Parcelize
@TypeConverters(DateConverter::class)
@Entity(tableName = "search_results")
data class SearchResult(
@PrimaryKey
val id: String,
@Json(name = "type")
val type: SearchResultType,
@Json(name = "title")
val title: String,
@Json(name = "snippet")
val snippet: String? = null,
@Json(name = "link")
val link: String? = null,
@Json(name = "feedTitle")
val feedTitle: String? = null,
@Json(name = "published")
val published: Date? = null,
@Json(name = "score")
val score: Double? = null
) : Parcelable
enum class SearchResultType {
@Json(name = "article")
ARTICLE,
@Json(name = "feed")
FEED
}