rep

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SuccessCode    = 200
	ErrorCode      = 100
	ErrorParameter = 422
	SuccessMsg     = "success"
	ErrorMsg       = "error"
	ParameterMsg   = "参数错误"
)

Functions

func DataWithErr added in v1.0.2

func DataWithErr(ctx *gin.Context, err error, data interface{}, fns ...ResponseFn)

func Error

func Error(ctx *gin.Context, fns ...ResponseFn)

Error /*

func ParameterError added in v1.0.2

func ParameterError(ctx *gin.Context, fns ...ResponseFn)

ParameterError /*

func Success

func Success(ctx *gin.Context, fns ...ResponseFn)

Success /*

func WeChatPayError

func WeChatPayError(ctx *gin.Context)

WeChatPayError /*

func WeChatPaySuccess

func WeChatPaySuccess(ctx *gin.Context)

Types

type Response

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

type ResponseFn

type ResponseFn func(response *Response) *Response

func Code

func Code(code int) ResponseFn

Code /*

func Data

func Data(data interface{}) ResponseFn

Data /*

func Err

func Err(err error) ResponseFn

Err /*

func Msg

func Msg(msg string) ResponseFn

Msg /*

Jump to

Keyboard shortcuts

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