model

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pagination

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

Pagination 结构体表示分页参数

func NewPagination

func NewPagination(page, pageSize int) *Pagination

NewPagination 返回一个新的分页结构体实例

func (*Pagination) CalculateOffset

func (p *Pagination) CalculateOffset() int

CalculateOffset 根据分页参数计算偏移量

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Response 结构体表示通用的响应格式

func NewErrorResponse

func NewErrorResponse(code int, message string) *Response

NewErrorResponse 返回一个错误的响应

func NewSuccessResponse

func NewSuccessResponse(data interface{}) *Response

NewSuccessResponse 返回一个成功的响应

Jump to

Keyboard shortcuts

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