pagination

package
v0.0.0-...-abd0671 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResponse

type HTTPResponse struct {
	Results interface{} `json:"results"`
	Total   int         `json:"total"`
}

HTTPResponse 分页返回结构体

type PageResponse

type PageResponse struct {
	Limit  int        `json:"limit"`
	Offset int        `json:"offset"`
	Order  string     `json:"order"`
	Total  int        `json:"total"`
	Query  *mgo.Query `json:"query"`
}

PageResponse 分页传入结构体

type Pagination

type Pagination struct {
	Controller  *gin.Context
	Table       string                 `json:"table"`
	SearchField []string               `json:"search_field"`
	FilterField []string               `json:"filter_field"`
	NumberField []string               `json:"number_field"`
	NewQs       map[string]interface{} `json:"new"`
}

Pagination 分页结构体

func (Pagination) Query

func (p Pagination) Query() PageResponse

Query 查询方法

Jump to

Keyboard shortcuts

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