Add trading scores
This commit is contained in:
parent
b0909c6f7e
commit
ae1d9331ad
4 changed files with 229 additions and 0 deletions
|
@ -40,6 +40,9 @@ func main() {
|
|||
attrs = append(attrs, strings.ToLower(v.Name))
|
||||
}
|
||||
|
||||
t := e.Group(`/trading`)
|
||||
t.GET(`/:meter/scores`, getScores)
|
||||
|
||||
panic(e.Start(`localhost:33333`))
|
||||
}
|
||||
|
||||
|
@ -72,3 +75,12 @@ func getAttr(index int) echo.HandlerFunc {
|
|||
return c.JSON(200, app.GetAttribute(index, meter, date))
|
||||
}
|
||||
}
|
||||
|
||||
func getScores(c echo.Context) error {
|
||||
meter, err := strconv.Atoi(c.Param(`meter`))
|
||||
if err != nil {
|
||||
return c.NoContent(400)
|
||||
}
|
||||
|
||||
return c.JSON(200, app.GetScores(meter))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue