result

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IP

func IP(c *gin.Context) string

func Init

func Init() gin.HandlerFunc

Types

type Response

type Response struct {
	Code    int         `json:"code"`    // 错误码
	Data    interface{} `json:"data"`    // 数据
	Message string      `json:"message"` // 提示信息
}

type Result

type Result struct {
	Ctx *gin.Context
}
var ApiResponse *Result

func NewResult

func NewResult(ctx *gin.Context) *Result

func (*Result) Error

func (r *Result) Error(response Response)

func (*Result) Json

func (r *Result) Json(code int, obj interface{})

func (*Result) Success

func (r *Result) Success(response Response)

Jump to

Keyboard shortcuts

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