v0

package
v0.0.0-...-75a1acf Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GormPaginate

func GormPaginate(page *Page) func(db *gorm.DB) *gorm.DB

func Paginate

func Paginate(r *http.Request) func(db *gorm.DB) *gorm.DB

参考 https://gorm.io/zh_CN/docs/scopes.html gorm 官方分页实例 详情

func Post

func Post(body io.Reader, url string) (string, error)

func SelectPage

func SelectPage(p *Page, query *gorm.DB, model interface{}) (e error)

Types

type Page

type Page struct {
	PageNo   int64       `json:"page_no"`
	PageSize int64       `json:"page_size"`
	Total    int64       `json:"total"` // 总记录数
	Pages    int64       `json:"pages"` // 总页数
	List     interface{} `json:"list"`  // 实际的list数据
}

type PageInfo

type PageInfo struct {
	// contains filtered or unexported fields
}

type ResponseInfo

type ResponseInfo struct {
	Code int64  `json:"code,omitempty"`
	Msg  string `json:"msg,omitempty"`
}

Jump to

Keyboard shortcuts

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