jct-popup-list1-page.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package controllers_join
  2. import (
  3. "encoding/json"
  4. "kkscrap-go/locals"
  5. models_join "kkscrap-go/models/join"
  6. "net/http"
  7. "github.com/dabory/abango-rest"
  8. "github.com/labstack/echo"
  9. )
  10. type PopupList1PageReq struct {
  11. QueryVars locals.QueryVars
  12. PopupList1Vars locals.PopupList1Vars
  13. ListType1Vars locals.ListType1Vars
  14. PageVars locals.PageVars
  15. }
  16. func PopupList1Page(c echo.Context) error {
  17. v := c.Get("receiver").(PopupList1PageReq)
  18. y := c.Get("abango").(abango.Controller)
  19. vRet := &struct {
  20. models_join.PopupList1PageRet
  21. }{}
  22. vRet.QueryVars = v.QueryVars
  23. vRet.ListType1Vars = v.ListType1Vars
  24. vRet.PopupList1Vars = v.PopupList1Vars
  25. vRet.PageVars = v.PageVars
  26. if v.ListType1Vars.IsDownloadList == false {
  27. if err := vRet.GetPopupList1PagePlain(&y); err != nil {
  28. return c.String(607, err.Error())
  29. }
  30. } else if v.ListType1Vars.IsDownloadList == true {
  31. if err := vRet.GetPopupList1PageTmp(&y); err != nil {
  32. return c.String(607, err.Error())
  33. }
  34. }
  35. ret, _ := json.Marshal(vRet)
  36. return c.JSONBlob(http.StatusOK, ret)
  37. }