scouting: Add support /requests/request/all_matches
This patch adds a new endpoint that accepts the `RequestAllMatches`
message. It simply returns the full list of matches that the database
knows about.
I decided to change public `int` members in the `db` module to `int32`
so they match the flatbuffer definition. This makes comparison
simpler.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I9bb2eed020e2889644f5a122105a232a68f2f4bd
diff --git a/scouting/db/db.go b/scouting/db/db.go
index 12f4153..549dfae 100644
--- a/scouting/db/db.go
+++ b/scouting/db/db.go
@@ -12,9 +12,9 @@
}
type Match struct {
- MatchNumber, Round int
+ MatchNumber, Round int32
CompLevel string
- R1, R2, R3, B1, B2, B3 int
+ R1, R2, R3, B1, B2, B3 int32
// Each of these variables holds the matchID of the corresponding Stats row
r1ID, r2ID, r3ID, b1ID, b2ID, b3ID int
}
@@ -74,7 +74,7 @@
return (error_)
}
var rowIds [6]int64
- for i, teamNumber := range []int{m.R1, m.R2, m.R3, m.B1, m.B2, m.B3} {
+ for i, teamNumber := range []int32{m.R1, m.R2, m.R3, m.B1, m.B2, m.B3} {
result, error_ := statement.Exec(teamNumber, m.MatchNumber, 0, 0, 0, 0, 0, 0, 0, 0)
if error_ != nil {
fmt.Println("failed to execute statement 2:", error_)