统一分页回传结构体

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
+7 -7
View File
@@ -86,7 +86,7 @@ func GetExaCustomer(c *gin.Context) {
if err != nil {
response.FailWithMessage(fmt.Sprintf("获取失败:%v", err), c)
} else {
response.OkWithData( resp.ExaCustomerResponse{Customer: customer}, c)
response.OkWithData(resp.ExaCustomerResponse{Customer: customer}, c)
}
}
@@ -107,11 +107,11 @@ func GetExaCustomerList(c *gin.Context) {
if err != nil {
response.FailWithMessage(fmt.Sprintf("创建失败:%v", err), c)
} else {
response.Result(response.SUCCESS, gin.H{
"customer": customerList,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
}, "创建成功", c)
response.OkWithData(resp.PageResult{
List: customerList,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, c)
}
}