This commit is contained in:
laodaming 2023-06-29 11:38:38 +08:00
parent c422f493f4
commit 02c41a5069
4 changed files with 18 additions and 19 deletions

View File

@ -256,11 +256,11 @@ func (l *GetCloudListLogic) GetCloudList(req *types.GetCloudListReq, userinfo *a
TransitBoxes: transitBoxes,
MinTakeNum: 3,
ListData: listDataRsp,
Pagnation: types.Pagnation{
Meta: types.Meta{
TotalCount: total,
TotalPage: int64(math.Ceil(float64(total) / float64(req.PageSize))),
CurPage: req.Page,
PageSize: req.PageSize,
PageCount: int64(math.Ceil(float64(total) / float64(req.PageSize))),
CurrentPage: req.Page,
PerPage: req.PageSize,
},
})
}

View File

@ -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值

View File

@ -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"`
}

View File

@ -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"`