response

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRsp

func HandleRsp(ctx *gin.Context, data interface{}, err error)

Types

type Result

type Result struct {
	ICode    int         `json:"status"`
	IMessage string      `json:"message"`
	IData    interface{} `json:"data"`
}

func NewErrResult

func NewErrResult(ctx *gin.Context, customErr *exceptions.CustomError) *Result

func NewResult

func NewResult() *Result

func (*Result) Code

func (result *Result) Code(code int) *Result

func (*Result) Data

func (result *Result) Data(data interface{}) *Result

func (*Result) I18nMsg

func (result *Result) I18nMsg(ctx *gin.Context, msg string) *Result

对消息进行国际化翻译

func (*Result) Message

func (result *Result) Message(msg string) *Result

Jump to

Keyboard shortcuts

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