jsdw_ios/QuickLocation/Manager/Account/UserConfigModel.swift

76 lines
1.7 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// UserConfigModel.swift
// QuickLocation
//
// Created by 八条 on 2026/5/26.
//
import ObjectMapper
import RxDataSources
struct UserConfigModel: Mappable {
var token: String?
var phone: String?
var name: String?
var avater: String?
/// 头像,对应本地图标
var head_pic: String = "1"
/// 用户头像
var userIcon: UIImage {
UIImage(named: "UserIcon/\(head_pic)") ?? UIImage()
}
/// 性别
var sex: Int = -1
/// 是否游客
var temp: Bool = true
/// 用户 ID
var uid: String?
/// 会员 1:非会员 2:普通会员 3:终身会员
var vip: Int = 1
/// 会员类型
var vip_name: String = ""
/// 会员过期时间
var vip_expire_time: String = ""
/// Config
var config: SystemConfigModel?
init?(map: Map) {
}
mutating func mapping(map: Map) {
token <- map["token"]
temp <- map["temp"]
phone <- map["phone"]
name <- map["name"]
uid <- map["user_id"]
avater <- map["avater"]
sex <- map["sex"]
head_pic <- (map["head_pic"], kIntTransformStr)
config <- map["config"]
vip <- map["vip"]
vip_name <- map["vip_name"]
vip_expire_time <- map["vip_expire_time"]
}
}
struct SystemConfigModel: Mappable {
/// 聊天界面的警告说明
var chatWarning: String = ""
/// 圈子里的banner
var groupBannerList: [String] = []
init?(map: Map) {
}
mutating func mapping(map: Map) {
chatWarning <- map["client.chatwarning", nested: false]
groupBannerList <- map["client.team.ad", nested: false]
}
}