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

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