diff --git a/biz/main/src/main/kotlin/io/goooler/demoapp/main/bean/MainRepoListBean.kt b/biz/main/src/main/kotlin/io/goooler/demoapp/main/bean/MainRepoListBean.kt index c9f15c51f..0e22111e1 100644 --- a/biz/main/src/main/kotlin/io/goooler/demoapp/main/bean/MainRepoListBean.kt +++ b/biz/main/src/main/kotlin/io/goooler/demoapp/main/bean/MainRepoListBean.kt @@ -10,37 +10,20 @@ import io.goooler.demoapp.common.network.BaseResponse @JsonClass(generateAdapter = true) @Entity(tableName = "main_repo_list", ignoredColumns = ["message", "code"]) -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?, + ) } diff --git a/common/src/main/kotlin/io/goooler/demoapp/common/util/RoomHelper.kt b/common/src/main/kotlin/io/goooler/demoapp/common/util/RoomHelper.kt index 92fd4bd40..e349673ce 100644 --- a/common/src/main/kotlin/io/goooler/demoapp/common/util/RoomHelper.kt +++ b/common/src/main/kotlin/io/goooler/demoapp/common/util/RoomHelper.kt @@ -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 create(db: Databases = Databases.Demo): T { return Room.databaseBuilder(CommonApplication.app, T::class.java, db.dbName)