//
//  UserModel.swift
//  AiKeyboard
//
//  Created by Destiny on 2025/4/29.
//

import Foundation
import ObjectMapper

// MARK: Initializer and Properties
struct UserModel: Mappable {

    var userId: String?

    var ssid: String?
    
    var deviceId: String?
    
    var phone: String?
    
    var loginStatus: Int?
    
    var channelName: String?
    
    var name: String?
    
    var gender: Int?
    
    var birthday: String?
    
    var userIdOrSsid: String?
    
    var imageUrl: String?
    
    var account: String?
    
    var memberInfo: MemberModel?

    // MARK: JSON
    init?(map: Map) { }

    mutating func mapping(map: Map) {
        userId <- map["userId"]
        ssid <- map["ssid"]
        deviceId <- map["deviceId"]
        phone <- map["phone"]
        loginStatus <- map["loginStatus"]
        channelName <- map["channelName"]
        name <- map["name"]
        gender <- map["gender"]
        birthday <- map["birthday"]
        userIdOrSsid <- map["userIdOrSsid"]
        imageUrl <- map["imageUrl"]
        account <- map["account"]
        memberInfo <- map["memberInfo"]
    }
}

struct MemberModel: Mappable {
    
    var isMember: Bool?

    var endTimestamp: Int?
    
    var permanent: Bool?

    // MARK: JSON
    init?(map: Map) { }
    
    mutating func mapping(map: Map) {
        isMember <- map["isMember"]
        endTimestamp <- map["endTimestamp"]
        permanent <- map["permanent"]
    }
}
