47 lines
834 B
Swift
47 lines
834 B
Swift
import Fluent
|
|
import Vapor
|
|
|
|
final class Match: Model, Content {
|
|
static let schema = "match"
|
|
|
|
@ID(key: .id)
|
|
var id: UUID?
|
|
|
|
@Field(key: "map")
|
|
var map: String?
|
|
|
|
@Field(key: "win")
|
|
var win: Bool
|
|
|
|
@Field(key: "date")
|
|
var date: Date
|
|
|
|
@Field(key: "roundsWon")
|
|
var roundsWon: Int?
|
|
|
|
@Field(key: "roundsLost")
|
|
var roundsLost: Int?
|
|
|
|
@Field(key: "codGame")
|
|
var codGame: String
|
|
|
|
init() { }
|
|
|
|
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String) {
|
|
self.id = id
|
|
self.map = map
|
|
self.win = win
|
|
self.date = date
|
|
self.roundsWon = roundsWon
|
|
self.roundsLost = roundsLost
|
|
self.codGame = codGame;
|
|
}
|
|
|
|
}
|
|
|
|
extension Match {
|
|
struct Create: Content {
|
|
}
|
|
}
|
|
|