jsdw_ios/QuickLocation/Model/EmergencyContactModel.swift

58 lines
1.1 KiB
Swift

//
// EmergencyContactModel.swift
// QuickLocation
//
// Created by on 2026/6/11.
//
import ObjectMapper
import RxDataSources
///
struct EmergencyContactListResponse: BaseModelProtocol {
//
var code: String?
//
var message: String?
//
var list: [EmergencyContactModel] = []
init?(map: Map) {}
mutating func mapping(map: Map) {
code <- map["code"]
message <- map["msg"]
list <- map["data"]
}
}
struct EmergencyContactModel: Mappable, Equatable {
var uuid: String = UUID().uuidString
var id: String = ""
var name: String = ""
var phone: String = ""
var ischecked: Bool = false
init?(map: Map) {
}
mutating func mapping(map: Map) {
id <- map["id"]
if id.isEmpty {
id <- map["contact_id"]
}
name <- map["name"]
phone <- map["phone"]
ischecked <- map["ischecked"]
}
}
extension EmergencyContactModel: IdentifiableType {
public typealias Identity = String
public var identity: String {
return uuid
}
}