diff --git a/server/inventory/internal/logic/getcloudlistlogic.go b/server/inventory/internal/logic/getcloudlistlogic.go index 81e58acc..82c06abf 100644 --- a/server/inventory/internal/logic/getcloudlistlogic.go +++ b/server/inventory/internal/logic/getcloudlistlogic.go @@ -256,11 +256,11 @@ func (l *GetCloudListLogic) GetCloudList(req *types.GetCloudListReq, userinfo *a TransitBoxes: transitBoxes, MinTakeNum: 3, ListData: listDataRsp, - Pagnation: types.Pagnation{ - TotalCount: total, - TotalPage: int64(math.Ceil(float64(total) / float64(req.PageSize))), - CurPage: req.Page, - PageSize: req.PageSize, + Meta: types.Meta{ + TotalCount: total, + PageCount: int64(math.Ceil(float64(total) / float64(req.PageSize))), + CurrentPage: req.Page, + PerPage: req.PageSize, }, }) } diff --git a/server/inventory/internal/types/types.go b/server/inventory/internal/types/types.go index 7b9a7b94..40d7272c 100644 --- a/server/inventory/internal/types/types.go +++ b/server/inventory/internal/types/types.go @@ -26,7 +26,7 @@ type GetCloudListRsp struct { TransitBoxes int64 `json:"transit_boxes"` MinTakeNum int64 `json:"minTakeNum"` ListData []ListDataItem `json:"listData"` - Pagnation Pagnation `json:"pagnation"` + Meta Meta `json:"_meta"` } type ListDataItem struct { @@ -85,11 +85,11 @@ type Auth struct { RefreshAfter int64 `json:"refreshAfter"` } -type Pagnation struct { - TotalCount int64 `json:"total_count"` - TotalPage int64 `json:"total_page"` - CurPage int `json:"cur_page"` - PageSize int `json:"page_size"` +type Meta struct { + TotalCount int64 `json:"totalCount"` + PageCount int64 `json:"pageCount"` + CurrentPage int `json:"currentPage"` + PerPage int `json:"perPage"` } // Set 设置Response的Code和Message值 diff --git a/server_api/basic.api b/server_api/basic.api index 13658fad..e05b76d5 100644 --- a/server_api/basic.api +++ b/server_api/basic.api @@ -26,10 +26,9 @@ type Auth { } // 统一分页 -type Pagnation{ - TotalCount int64 `json:"total_count"` - TotalPage int64 `json:"total_page"` - CurPage int `json:"cur_page"` - PageSize int `json:"page_size"` -} - +type Meta struct { + TotalCount int64 `json:"totalCount"` + PageCount int64 `json:"pageCount"` + CurrentPage int `json:"currentPage"` + PerPage int `json:"perPage"` +} \ No newline at end of file diff --git a/server_api/inventory.api b/server_api/inventory.api index efd43195..803b1041 100644 --- a/server_api/inventory.api +++ b/server_api/inventory.api @@ -43,7 +43,7 @@ type GetCloudListRsp { TransitBoxes int64 `json:"transit_boxes"` MinTakeNum int64 `json:"minTakeNum"` ListData []ListDataItem `json:"listData"` - Pagnation Pagnation `json:"pagnation"` + Meta Meta `json:"_meta"` } type ListDataItem { Id int64 `json:"id"`