Documentation ¶ Index ¶ func DataPagination(c *gin.Context, list interface{}, total int, query *PaginationQ) func Fail(c *gin.Context, data interface{}, msg string) func Success(c *gin.Context, data interface{}, msg string) type PaginationQ Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func DataPagination ¶ func DataPagination(c *gin.Context, list interface{}, total int, query *PaginationQ) 拼装json 分页数据 func Fail ¶ func Fail(c *gin.Context, data interface{}, msg string) func Success ¶ func Success(c *gin.Context, data interface{}, msg string) Types ¶ type PaginationQ ¶ type PaginationQ struct { Ok bool `json:"ok"` PageSize int `form:"size" json:"size"` Page int `form:"page" json:"page"` Data interface{} `json:"data" comment:"muster be a pointer of slice gorm.Model"` TotalSize int `json:"total"` } Source Files ¶ View all Source files response.go Click to show internal directories. Click to hide internal directories.