123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package controllers_join
- import (
- "boiler-go/locals"
- models_join "boiler-go/models/join"
- "encoding/json"
- "net/http"
- "github.com/dabory/abango-rest"
- "github.com/labstack/echo"
- )
- type ChartLine2PageReq struct {
- QueryVars locals.QueryVars
- ChartLine2Vars locals.ListType1Vars
- PageVars locals.PageVars
- }
- type ChartType1PageReq struct {
- QueryVars locals.QueryVars
- ChartLine2Vars locals.ListType1Vars
- PageVars locals.PageVars
- }
- func ChartLine2Page(c echo.Context) error {
- v := c.Get("receiver").(ChartLine2PageReq)
- y := c.Get("abango").(abango.Controller)
- vRet := &struct {
- models_join.ChartLine2PageRet
- }{}
- vRet.QueryVars = v.QueryVars
- vRet.ChartLine2Vars = v.ChartLine2Vars
- if err := vRet.GetChartLine2Page(&y); err != nil {
- return c.String(607, err.Error())
- }
- ret, _ := json.Marshal(vRet)
- return c.JSONBlob(http.StatusOK, ret)
- }
- func ChartType1Page(c echo.Context) error {
- v := c.Get("receiver").(ChartType1PageReq)
- y := c.Get("abango").(abango.Controller)
- vRet := &struct {
- models_join.ChartType1PageRet
- }{}
- vRet.QueryVars = v.QueryVars
- vRet.ChartLine2Vars = v.ChartLine2Vars
- if err := vRet.GetChartType1Page(&y); err != nil {
- return c.String(607, err.Error())
- }
- ret, _ := json.Marshal(vRet)
- return c.JSONBlob(http.StatusOK, ret)
- }
|