commons

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 1 Imported by: 5

README

commons

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResponse

type ActionResponse struct {
	// 是否成功
	Success bool `json:"success"`
	// 错误码
	ErrCode int `json:"errCode,omitempty"`
	// 错误内容
	ErrMessage string `json:"errMessage,omitempty"`
	// 返回值
	Data interface{} `json:"data,omitempty"`
}

通用的返回模型

type PagingRequest

type PagingRequest struct {
	// 一页多少条
	PageSize int64 `json:"pageSize" form:"pageSize"`
	//当前多少页,从1开始
	CurPage int64 `json:"curPage" form:"curPage"`
}

分页查询参数

type PagingResponse

type PagingResponse struct {
	PagingRequest
	// 总页数
	TotalPage int64 `json:"totalPage"`
	// 总记录数
	TotalCount int64 `json:"totalCount" bson:"totalCount"`
	// 分页实体数据
	Data interface{} `json:"data,omitempty"`
}

分页返回模型

func (*PagingResponse) Compute

func (resp *PagingResponse) Compute()

计算总页数

Jump to

Keyboard shortcuts

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