diff --git a/app/internal/model/db.json b/app/internal/model/db.json index ba3c843..d540094 100644 --- a/app/internal/model/db.json +++ b/app/internal/model/db.json @@ -74,24 +74,6 @@ "null": false, "size": 8 }, - { - "name": "p_gem_1", - "type": "double precision", - "null": false, - "size": 8 - }, - { - "name": "p_gem_2", - "type": "double precision", - "null": false, - "size": 8 - }, - { - "name": "p_gem_3", - "type": "double precision", - "null": false, - "size": 8 - }, { "name": "p_max_1", "type": "double precision", @@ -110,24 +92,6 @@ "null": false, "size": 8 }, - { - "name": "s_gem_1", - "type": "double precision", - "null": false, - "size": 8 - }, - { - "name": "s_gem_2", - "type": "double precision", - "null": false, - "size": 8 - }, - { - "name": "s_gem_3", - "type": "double precision", - "null": false, - "size": 8 - }, { "name": "s_max_1", "type": "double precision", diff --git a/server/main.go b/server/main.go index d766d00..3bfab4a 100644 --- a/server/main.go +++ b/server/main.go @@ -28,10 +28,14 @@ func main() { e.HideBanner = true e.Use(recoverMiddleware) - e.GET(`/count`, count) + pq := e.Group(`/pq`) + pq.GET(`/count`, count) + pq.GET(`/list`, listAttr) for _, v := range app.GetAttributes() { - e.GET(`/`+strings.ToLower(v.Name)+`/:date`, getAttr(v.Index)) + pq.GET(`/`+strings.ToLower(v.Name)+`/:date`, getAttr(v.Index)) + + attrs = append(attrs, strings.ToLower(v.Name)) } panic(e.Start(`localhost:33333`)) @@ -41,6 +45,12 @@ func count(c echo.Context) error { return c.JSON(200, app.Count()) } +var attrs []string + +func listAttr(c echo.Context) error { + return c.JSON(200, attrs) +} + func getAttr(index int) echo.HandlerFunc { return func(c echo.Context) error { date, err := time.Parse(time.RFC3339, c.Param(`date`))