|
|
@@ -1,11 +1,17 @@
|
|
|
package com.adealink.weparty.module.account.data
|
|
|
|
|
|
+import android.os.Parcelable
|
|
|
+import com.google.gson.annotations.JsonAdapter
|
|
|
import com.google.gson.annotations.SerializedName
|
|
|
+import com.google.gson.internal.bind.ExtReflectiveTypeAdapterFactory
|
|
|
+import kotlinx.parcelize.Parcelize
|
|
|
+import java.util.Locale
|
|
|
|
|
|
enum class UserKickReason(val value: Long) {
|
|
|
//客户端自定义的
|
|
|
REASON_LOCAL_KICK_TOKEN_EXPIRE(-1),//token过期
|
|
|
REASON_LOCAL_KICK_BLOCK(-2),//封禁账号
|
|
|
+
|
|
|
//服务端定义的
|
|
|
REASON_KICK_ONLINE_BY_MULTIPOINT_LOGIN(1),
|
|
|
REASON_BE_BLOCK(2)//被封禁
|
|
|
@@ -14,4 +20,45 @@ enum class UserKickReason(val value: Long) {
|
|
|
data class BannerInfoRes(
|
|
|
@SerializedName("reason") val reason: String,
|
|
|
@SerializedName("expire") val expire: Long,
|
|
|
+)
|
|
|
+
|
|
|
+
|
|
|
+@Parcelize
|
|
|
+@JsonAdapter(ExtReflectiveTypeAdapterFactory::class)
|
|
|
+data class SmsCountryInfo(
|
|
|
+ @SerializedName("areaCode") val areaCode: String,
|
|
|
+ @SerializedName("countryCode") val countryCode: String,
|
|
|
+ @SerializedName("countryName") var countryName: String,
|
|
|
+ @SerializedName("flag") val flag: String,
|
|
|
+ @SerializedName("supportSms") val supportSms: Boolean,
|
|
|
+ var localeName: String = ""
|
|
|
+) : Parcelable {
|
|
|
+ fun fill(): SmsCountryInfo {
|
|
|
+ localeName = countryName
|
|
|
+ val locale = Locale("", this.countryCode)
|
|
|
+ val lc = locale.displayCountry
|
|
|
+ if (lc.isNotEmpty()) {
|
|
|
+ localeName = lc
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isChinaRegion(this.countryCode)) {
|
|
|
+ val cLocale = Locale("", "CN")
|
|
|
+ val clc = cLocale.displayCountry
|
|
|
+ if (clc.isNotEmpty()) {
|
|
|
+ localeName = "$clc/$localeName"
|
|
|
+ }
|
|
|
+ countryName = "China/$countryName"
|
|
|
+ }
|
|
|
+ return this
|
|
|
+ }
|
|
|
+
|
|
|
+ private fun isChinaRegion(cc: String): Boolean {
|
|
|
+ return "TW" == cc || "MO" == cc || "HK" == cc
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+data class GetSmsCountryReq(
|
|
|
+ @SerializedName("deviceId") val deviceId: String,
|
|
|
+ @SerializedName("newDeviceId") val newDeviceId: String,
|
|
|
)
|