123456789101112131415161718192021222324252627282930313233343536373839 |
- package controllers_join
- import (
- "encoding/json"
- "kkscrap-go/locals"
- models_join "kkscrap-go/models/join"
- "net/http"
- "github.com/dabory/abango-rest"
- "github.com/labstack/echo"
- )
- type MediaSearchPageReq struct {
- QueryVars locals.QueryVars
- MediaSearchVars locals.MediaSearchVars
- PageVars locals.PageVars
- }
- func MediaSearchPage(c echo.Context) error {
- v := c.Get("receiver").(MediaSearchPageReq)
- y := c.Get("abango").(abango.Controller)
- vRet := &struct {
- models_join.MediaSearchPageRet
- }{}
- vRet.QueryVars = v.QueryVars
- vRet.MediaSearchVars = v.MediaSearchVars
- vRet.PageVars = v.PageVars
- // fmt.Println(vRet)
- if err := vRet.GetMediaSearchPage(y.Db); err != nil {
- return c.String(607, err.Error())
- }
- ret, _ := json.Marshal(vRet)
- return c.JSONBlob(http.StatusOK, ret)
- }
|