added basic skeleton and two API endpoints to test backend stack.

This commit is contained in:
2022-04-12 20:30:16 +02:00
parent 22e8290371
commit 11c0bd62e2
40 changed files with 1480 additions and 8 deletions
+1 -1
View File
@@ -13,5 +13,5 @@ type Item struct {
CreatedTime time.Time
AcquiredTime *time.Time
ScheduledDate *time.Time
Stats StatProgressEntry[]
Stats []StatProgressEntry
}
+12 -2
View File
@@ -1,7 +1,7 @@
package models
type ScopeEntry struct {
ID string `json:"id"`
ID int `json:"id"`
Name string `json:"name"`
Abbreviation string `json:"abbreviation"`
}
@@ -18,5 +18,15 @@ type Scope struct {
DisplayName string `json:"displayName"`
Members []ScopeMember `json:"members"`
Projects []ProjectEntry `json:"projects"`
Stat []Stat `json:"stat"`
Stats []Stat `json:"stats"`
}
func (s *Scope) HasMember(id string) bool {
for _, user := range s.Members {
if user.ID == id {
return true
}
}
return false
}
+1 -1
View File
@@ -1,7 +1,7 @@
package models
type StatEntry struct {
ID string `json:"id"`
ID int `json:"id"`
Name string `json:"name"`
Weight float64 `json:"weight"`
}