统一分页回传结构体

This commit is contained in:
pixel
2020-04-08 14:31:22 +08:00
parent 4277505c6a
commit 1051db5d4c
8 changed files with 45 additions and 38 deletions

View File

@@ -202,12 +202,12 @@ func GetUserList(c *gin.Context) {
if err != nil {
response.FailWithMessage(fmt.Sprintf("获取数据失败,%v", err), c)
} else {
response.OkDetailed(gin.H{
"userList": list,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
}, "获取数据成功", c)
response.OkWithData(resp.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, c)
}
}