1234567891011121314151617181920212223242526 |
- package vo
- type PageReq struct {
- Current int `json:"current"`
- PageSize int `json:"pageSize"`
- Offset int `json:"offset"`
- }
- func (r *PageReq) Ensure() {
- if r.Current < 1 {
- r.Current = 1
- }
- if r.PageSize < 1 {
- r.PageSize = 10
- }
- if r.Offset == 0 {
- r.Offset = (r.Current - 1) * r.PageSize
- }
- }
- type PageResp struct {
- Total int64 `json:"total"`
- List interface{} `json:"list"`
- Current int `json:"current"`
- PageSize int `json:"pageSize"`
- }
|