|
|
|
@ -190,6 +190,19 @@ data class BookSource( |
|
|
|
|
private fun equal(a: String?, b: String?) = a == b || (a.isNullOrEmpty() && b.isNullOrEmpty()) |
|
|
|
|
|
|
|
|
|
class Converters { |
|
|
|
|
@TypeConverter |
|
|
|
|
fun loginRuleTString(loginRule: LoginRule?): String = GSON.toJson(loginRule) |
|
|
|
|
|
|
|
|
|
@TypeConverter |
|
|
|
|
fun stringToLoginRule(json: String?): LoginRule? { |
|
|
|
|
json ?: return null |
|
|
|
|
return if (json.isJsonObject()) { |
|
|
|
|
GSON.fromJsonObject(json) |
|
|
|
|
} else { |
|
|
|
|
LoginRule(url = json) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@TypeConverter |
|
|
|
|
fun exploreRuleToString(exploreRule: ExploreRule?): String = GSON.toJson(exploreRule) |
|
|
|
|
|
|
|
|
|