Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Cleanup MainRepoListBean #198

Merged
merged 16 commits into from
Aug 27, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,20 @@ import io.goooler.demoapp.common.network.BaseResponse

@JsonClass(generateAdapter = true)
@Entity(tableName = "main_repo_list", ignoredColumns = ["message", "code"])
Goooler marked this conversation as resolved.
Show resolved Hide resolved
class MainRepoListBean : BaseResponse() {

@PrimaryKey
var id: Long = 0

@ColumnInfo
var private: Boolean = false

@ColumnInfo
var fork: Boolean = false

@ColumnInfo
var name: String? = null

@ColumnInfo
var description: String? = null

@Json(name = "full_name")
var fullName: String = ""

@Embedded
var owner: OwnerBean? = null
class MainRepoListBean(
@PrimaryKey val id: Long,
val private: Boolean,
val name: String,
@Json(name = "full_name") @ColumnInfo(name = "full_name")
val fullName: String,
@Embedded val owner: OwnerBean,
) : BaseResponse() {

@JsonClass(generateAdapter = true)
class OwnerBean {
@ColumnInfo(name = "owner_name")
@Json(name = "login")
var ownerName: String? = null

@ColumnInfo(name = "avatar_url")
@Json(name = "avatar_url")
var avatarUrl: String? = null
}
class OwnerBean(
@Json(name = "login") @ColumnInfo(name = "owner_name")
val ownerName: String,
@Json(name = "avatar_url") @ColumnInfo(name = "avatar_url")
val avatarUrl: String?,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.goooler.demoapp.common.CommonApplication
import io.goooler.demoapp.common.type.Databases

object RoomHelper {
const val DB_VERSION = 1
const val DB_VERSION = 2

inline fun <reified T : RoomDatabase> create(db: Databases = Databases.Demo): T {
return Room.databaseBuilder(CommonApplication.app, T::class.java, db.dbName)
Expand Down