func()

in cmd/controller/catalog.go [78:90]


func (c *CatalogController) QueryList(ctx *gin.Context) {
	request := QueryEventsRequest{}
	if err := ctx.ShouldBind(&request); err != nil {
		ctx.JSON(http.StatusBadRequest, err.Error())
		return
	}
	res, total, err := c.catalogDAL.SelectList(ctx, request.Page, request.Size)
	if err != nil {
		ctx.JSON(http.StatusInternalServerError, err.Error())
		return
	}
	ctx.JSON(http.StatusOK, &QueryEventsResponse{Total: total, Events: res})
}