/
data.go
59 lines (51 loc) · 1.72 KB
/
data.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
type response struct {
Status string `json:"status"`
Error string `json:"error,omitempty"`
Data interface{} `json:"data,omitempty"`
}
type user struct {
ID int `json:"id"`
Subteam string `json:"subteam"`
NetID string `json:"netId"`
FName string `json:"fname"`
LName string `json:"lname"`
Email string `json:"email"`
Picture string `json:"picture"`
UserLevel int `json:"userLevel"`
}
type rosterItem struct {
ID int `json:"id"`
SubteamID int `json:"subteamId"`
NetID string `json:"netId"`
FName string `json:"fname"`
LName string `json:"lname"`
Email string `json:"email"`
UserLevel int `json:"userLevel"`
TotalHours float64 `json:"totalHours"`
}
type category struct {
ID int `json:"id"`
Name string `json:"name"`
}
type subteam struct {
ID int `json:"id"`
Name string `json:"name"`
}
type hour struct {
ID int `json:"id"`
Hours float64 `json:"hours"`
Date string `json:"date"`
CategoryId int `json:"categoryId"`
MetGoals int `json:"metGoals"`
Description string `json:"desc"`
}
type hoursResponse struct {
Hours []hour `json:"hour"`
Categories []category `json:"categories"`
}
var missingParams = response{Status: "error", Error: "Required parameters were missing from the request"}
var internalServerErr = response{Status: "error", Error: "An internal server error occured while processing your request."}
var unauthorizedErr = response{Status: "error", Error: "Unauthorized"}
var userRecordMissing = response{Status: "error", Error: "Your user record is missing from the database. Contact a lead to be added to admin."}
var okResp = response{Status: "ok"}