You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lib/types/page.go

17 lines
220 B
Go

package types
// Page 頁數
type Page struct {
Current, Size int
}
// Take 取得數量
func (p Page) Take() int {
return p.Size
}
// Skip 忽略數量
func (p Page) Skip() int {
return (p.Current - 1) * p.Size
}