added some initial routes, ways to show overall stats, matches

This commit is contained in:
Michael Simard
2020-05-29 14:52:20 -05:00
parent c6f7dcec32
commit f48ddd77bf
9 changed files with 277 additions and 55 deletions

View File

@@ -0,0 +1,43 @@
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?
init() { }
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?) {
self.id = id
self.map = map
self.win = win
self.date = date
self.roundsWon = roundsWon
self.roundsLost = roundsLost
}
}
extension Match {
struct Create: Content {
}
}