app

package
v1.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 22

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 int32, 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"`
}

type Response

type Response struct {
	pbErrors.Error
	// 数据集
	Data interface{} `json:"data"`
}

func (*Response) ReturnError

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

func (*Response) ReturnOK

func (res *Response) ReturnOK() *Response

Jump to

Keyboard shortcuts

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