简化代码生成

This commit is contained in:
linwenxiang committed 2020-09-22 20:39:11 +08:00
1 parent 72a876f37a
commit f3e0e4dbc6
6 files changed
+26 -24

No files matched your search

+14
View File
@@ -4,3 +4,17 @@ type Pagination struct {
PageIndex int `form:"pageIndex"`
PageSize int `form:"pageSize"`
}
func (m *Pagination) GetPageIndex() int {
if m.PageIndex <= 0 {
m.PageIndex = 1
}
return m.PageIndex
}
func (m *Pagination) GetPageSize() int {
if m.PageSize <= 0 {
m.PageSize = 10
}
return m.PageSize
}