jct-select-type1-page.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package controllers_join
  2. import (
  3. "boiler-go/locals"
  4. models_join "boiler-go/models/join"
  5. "encoding/json"
  6. "net/http"
  7. "github.com/dabory/abango-rest"
  8. "github.com/labstack/echo"
  9. )
  10. type SelectType1PageReq struct {
  11. QueryVars locals.QueryVars
  12. // SetupVars []locals.SetupBase
  13. SelectType1Vars locals.SelectType1Vars
  14. PageVars locals.PageVars
  15. }
  16. func SelectType1Page(c echo.Context) error {
  17. v := c.Get("receiver").(SelectType1PageReq)
  18. y := c.Get("abango").(abango.Controller)
  19. vRet := &struct {
  20. models_join.SelectType1PageRet
  21. }{}
  22. // fmt.Println(v)
  23. // var vRet models_join.SelectType1PageRet
  24. vRet.QueryVars = v.QueryVars
  25. // vRet.SetupVars = v.SetupVars
  26. vRet.SelectType1Vars = v.SelectType1Vars
  27. vRet.PageVars = v.PageVars
  28. // r := c.Request().URL.Path
  29. sqlDir := "select"
  30. //당분간 아래 지우지 말것
  31. // if v.SelectType1Vars.IsDownloadList == false {
  32. // if err := vRet.GetSelectType1PagePlain(&y, sqlDir); err != nil {
  33. // return c.String(607, err.Error())
  34. // }
  35. // } else if v.SelectType1Vars.IsDownloadList == true {
  36. if err := vRet.GetSelectType1PageTmp(&y, sqlDir); err != nil {
  37. return c.String(607, err.Error())
  38. }
  39. // }
  40. // if len(vRet.SetupVars) != 0 {
  41. // if err := controllers_func.SetupJsonArrayGet(&y, &vRet); err != nil {
  42. // return c.String(607, err.Error())
  43. // }
  44. // }
  45. ret, _ := json.Marshal(vRet)
  46. return c.JSONBlob(http.StatusOK, ret)
  47. }