jct-slip-search-page.go 946 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package controllers_join
  2. import (
  3. "encoding/json"
  4. "net/http"
  5. "syncscan-go/locals"
  6. models_join "syncscan-go/models/join"
  7. "github.com/dabory/abango-rest"
  8. "github.com/labstack/echo"
  9. )
  10. type SlipSearchPageReq struct {
  11. QueryVars locals.QueryVars
  12. SlipSearchVars locals.SlipSearchVars
  13. SlipSearchFields locals.SlipSearchFields
  14. PageVars locals.PageVars
  15. }
  16. func SlipSearchPage(c echo.Context) error {
  17. v := c.Get("receiver").(SlipSearchPageReq)
  18. y := c.Get("abango").(abango.Controller)
  19. vRet := &struct {
  20. models_join.SlipSearchPageRet
  21. }{}
  22. vRet.QueryVars = v.QueryVars
  23. vRet.SlipSearchVars = v.SlipSearchVars
  24. vRet.SlipSearchFields = v.SlipSearchFields
  25. vRet.PageVars = v.PageVars
  26. // fmt.Println(y.Gtb.UserId)
  27. if err := vRet.GetSlipSearchPage(&y); err != nil {
  28. return c.String(607, err.Error())
  29. }
  30. ret, _ := json.Marshal(vRet)
  31. return c.JSONBlob(http.StatusOK, ret)
  32. }