db

package
v0.0.0-...-250bc44 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSize    = 20
	DefaultPage    = 1
	DefaultMaxSize = 50
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ListPage

type ListPage struct {
	TotalPage int64 `json:"totalPage"`
	Page      int64 `json:"page"`
	PageSize  int64 `json:"pageSize"`
	Total     int64 `json:"total"`
}

type Page

type Page struct {
	Page     int64 `json:"page"`
	PageSize int64 `json:"pageSize"`
}

func InitPageSize

func InitPageSize(page, size int64) Page

func (*Page) GetListPage

func (p *Page) GetListPage(total int64) ListPage

func (*Page) Offset

func (p *Page) Offset() int64

func (*Page) Paginate

func (p *Page) Paginate() func(d *gorm.DB) *gorm.DB

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL