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 Category struct{} func (r *Category) List(ctx *gin.Context) { var req request.CategoryList if err := ctx.Bind(&req); err != nil { err2.ParamErr(err) } res, count := new(service.Category).List(req) ctx.JSON(http.StatusOK, response.NewListRsp(count, res)) }