gitlab.com/evatix-go/core@v1.3.55/coredata/coreapi/PageRequest.go (about) 1 package coreapi 2 3 type PageRequest struct { 4 PageSize int 5 PageIndex int 6 } 7 8 func (it *PageRequest) IsPageSizeEmpty() bool { 9 return it == nil || it.PageSize <= 0 10 } 11 12 func (it *PageRequest) IsPageIndexEmpty() bool { 13 return it == nil || it.PageIndex <= 0 14 } 15 16 func (it *PageRequest) HasPageSize() bool { 17 return it != nil && it.PageSize > 0 18 } 19 20 func (it *PageRequest) HasPageIndex() bool { 21 return it != nil && it.PageIndex > 0 22 } 23 24 func (it *PageRequest) Clone() *PageRequest { 25 if it == nil { 26 return nil 27 } 28 29 return &PageRequest{ 30 PageSize: it.PageSize, 31 PageIndex: it.PageIndex, 32 } 33 }