import Foundation
struct CommentsModel {
var comment = ""
var gameId = ""
var timestamp = 0
var userId = ""
var userModel = UserModel(user: [:])
init(comment: [String: Any]) {
self.comment = comment["comment"] as? String ?? ""
self.gameId = comment["gameId"] as? String ?? ""
self.timestamp = comment["timestamp"] as? Int ?? 0
self.userId = comment["userId"] as? String ?? ""
if let userDict = comment["userModel"] as? [String: Any] {
self.userModel = UserModel(user: userDict)
}
}
}