load

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page

type Page struct {
	Page   int64 `json:"page" form:"page"`
	Size   int64 `json:"size" form:"size"`
	LastID int64 `json:"lastID" form:"lastID"`
}

func BuildPage

func BuildPage(ctx *gin.Context, page, pageSize, lastId int64) *Page

func (*Page) Limit

func (p *Page) Limit() int64

func (*Page) NextPage

func (p *Page) NextPage() int64

func (*Page) Offset

func (p *Page) Offset() int64

func (*Page) PrevPage

func (p *Page) PrevPage() int64

func (*Page) SetPage

func (p *Page) SetPage(page int64)

type PageResp

type PageResp struct {
	Page   int64  `json:"page"`
	Size   int64  `json:"size"`
	Total  *Total `json:"total"`
	LastID int64  `json:"lastID"`
	Result any    `json:"result"`
}

func (*PageResp) Build

func (r *PageResp) Build(page *Page, total *Total, LastID int64, result any)

func (*PageResp) BuildS

func (r *PageResp) BuildS(page *Page, LastID int64, result any)

type PageRespT

type PageRespT[T any] struct {
	Page   int64  `json:"page"`
	Size   int64  `json:"size"`
	Total  *Total `json:"total"`
	LastID int64  `json:"lastID"`
	Result *[]T   `json:"result"`
}

func Covert

func Covert[T any](r *PageResp) *PageRespT[T]

func (*PageRespT[T]) ParsePageResp

func (t *PageRespT[T]) ParsePageResp(r *PageResp, result *[]T) *PageRespT[T]

type Total

type Total int64

func (*Total) Get

func (t *Total) Get() int64

func (*Total) Set

func (t *Total) Set(total int64)

Jump to

Keyboard shortcuts

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