response

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Json

func Json(c *gin.Context, httpStatus int, code int, data interface{})

Json 响应操作

func JsonFail

func JsonFail(c *gin.Context, data interface{})

JsonFail 响应-失败

func JsonPage

func JsonPage(c *gin.Context, httpCode int, code int, data interface{}, total, totalPage int)

JsonPage 响应-分页

func JsonSuccess

func JsonSuccess(c *gin.Context, data interface{})

JsonSuccess 响应-成功

Types

type Paging

type Paging struct {
	Code      int         `json:"code"`
	Msg       string      `json:"message"`
	Data      interface{} `json:"data"`
	Total     int         `json:"total"`
	TotalPage int         `json:"totalPage"`
}

type Response

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

Jump to

Keyboard shortcuts

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