web

package
v0.0.0-...-3d980af Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InternalError

func InternalError(c *gin.Context, msg string)

InternalError 内部错误

func NotFoundResource

func NotFoundResource(c *gin.Context, msg string)

NotFoundResource 资源不存在

func ParamsError

func ParamsError(c *gin.Context, msg string)

ParamsError 参数错误

func StreamSuccess

func StreamSuccess(c *gin.Context, step func(w io.Writer) bool)

StreamSuccess .

func Success

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

Success 响应成功

func UnAuthorization

func UnAuthorization(c *gin.Context, msg string)

UnAuthorization 未授权

Types

type Response

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

Response 响应结构体

Jump to

Keyboard shortcuts

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