app

package
v0.0.0-...-594642b Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Custum

func Custum(c *gin.Context, data gin.H)

兼容函数

func Error

func Error(c *gin.Context, code int, err error, msg string)

失败数据处理

func OK

func OK(c *gin.Context, data interface{}, msg string)

通常成功数据处理

func PageOK

func PageOK(c *gin.Context, result interface{}, count int, pageIndex int, pageSize int, msg string)

分页数据处理

Types

type Page

type Page struct {
	List      interface{} `json:"list"`
	Count     int         `json:"count"`
	PageIndex int         `json:"pageIndex"`
	PageSize  int         `json:"pageSize"`

} //@name Page

type PageResponse

type PageResponse struct {
	// 代码
	Code int `json:"code" example:"200"`
	// 数据集
	Data Page `json:"data"`
	// 消息
	Msg string `json:"msg"`

} //@name PageResponse

func (*PageResponse) ReturnOK

func (res *PageResponse) ReturnOK() *PageResponse

type Response

type Response struct {
	// 代码
	Code int `json:"code" example:"200"`
	// 数据集
	Data interface{} `json:"data"`
	// 消息
	Msg string `json:"msg"`

} //@name Response

func (*Response) ReturnError

func (res *Response) ReturnError(code int) *Response

func (*Response) ReturnOK

func (res *Response) ReturnOK() *Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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