jct-setting-search-page.go 706 B

123456789101112131415161718192021222324252627282930313233343536
  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 SettingSearchPageReq struct {
  11. QueryVars locals.QueryVars
  12. PageVars locals.PageVars
  13. }
  14. func SettingSearchPage(c echo.Context) error {
  15. v := c.Get("receiver").(SettingSearchPageReq)
  16. y := c.Get("abango").(abango.Controller)
  17. vRet := &struct {
  18. models_join.SettingSearchPageRet
  19. }{}
  20. vRet.QueryVars = v.QueryVars
  21. vRet.PageVars = v.PageVars
  22. if err := vRet.GetSettingSearchPage(y.Db); err != nil {
  23. return c.String(607, err.Error())
  24. }
  25. ret, _ := json.Marshal(vRet)
  26. return c.JSONBlob(http.StatusOK, ret)
  27. }