init
This commit is contained in:
20
form/page.go
Normal file
20
form/page.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package form
|
||||
|
||||
type Page struct {
|
||||
PageIndex int `form:"page_index" json:"page_index"`
|
||||
PageSize int `form:"page_size" json:"page_size"`
|
||||
}
|
||||
|
||||
func (m *Page) GetPageIndex() int {
|
||||
if m.PageIndex <= 0 {
|
||||
m.PageIndex = 1
|
||||
}
|
||||
return m.PageIndex
|
||||
}
|
||||
|
||||
func (m *Page) GetPageSize() int {
|
||||
if m.PageSize <= 0 {
|
||||
m.PageSize = 10
|
||||
}
|
||||
return m.PageSize
|
||||
}
|
||||
Reference in New Issue
Block a user