package com.gh.gamecenter.login.entity

import com.google.gson.annotations.SerializedName

/**
 * Created by khy on 17/07/17.
 */
class UserInfoEntity {

    @SerializedName("_id")
    var userId: String? = null

    @SerializedName("_seq")
    private var shortUserId: Long? = null

    var name: String? = null

    var icon: String? = null

    var gender: String? = null

    var region: String? = null

    var contact: String? = null

    var qq: String? = ""

    var mobile: String? = ""

    var introduce: String? = null

    @SerializedName("id_card")
    var idCard: IdCardEntity? = null

    var auth: Auth? = null

    var badge: Badge? = null

    @SerializedName("register_type")
    var registerType: String? = null

    @SerializedName("login_mobile")
    var loginMobile: String? = null

    var background: BackgroundImageEntity? = null

    @SerializedName("icon_border")
    var iconBorder: AvatarBorderEntity? = null

    @SerializedName("mobile_auth")
    var mobileAuth: MobileAuthEntity? = null

    fun getShortUserId(): String {
        return if ((shortUserId?.toString()?.length ?: 0) < 8) {
            String.format("%08d", shortUserId)
        } else {
            shortUserId.toString()
        }
    }
}