yintai2/app/api/controller/page.go

23 lines
454 B
Go

package controller
import (
"net/http"
"yintai-api/app/api/request"
"yintai-api/app/api/service"
err2 "yintai-api/app/common/err"
"yintai-api/app/common/response"
"github.com/gin-gonic/gin"
)
type Page struct{}
func (r *Page) List(ctx *gin.Context) {
var req request.PageList
if err := ctx.Bind(&req); err != nil {
err2.ParamErr(err)
}
res, count := new(service.Page).List(req)
ctx.JSON(http.StatusOK, response.NewListRsp(count, res))
}