1234567891011121314151617181920212223242526272829 |
- package controllers
- import "eta_mini_ht_api/common/contants"
- type ListController struct {
- BaseController
- PageInfo PageInfo
- }
- func (l *ListController) Prepare() {
- pageSize, _ := l.GetInt("pageSize")
- currentIndex, _ := l.GetInt("currentIndex")
- if pageSize <= 0 {
- pageSize = contants.PageSizeDefault
- }
- if currentIndex <= 0 {
- currentIndex = 1
- }
- l.PageInfo = PageInfo{
- Current: currentIndex,
- PageSize: pageSize,
- }
- }
- type PageInfo struct {
- id int
- Current int
- PageSize int
- }
|