response

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomResponse

func CustomResponse(c *gin.Context, response *types2.Response)

func Fail

func Fail(c *gin.Context, code int, message string, args ...types2.RespOpt)

Fail 请求正常, 状态码200, 但是业务流不正常

func FailWithData

func FailWithData(c *gin.Context, code int, message string, data interface{}, args ...types2.RespOpt)

FailWithData 功能与Fail一致, 只不过FailWithData可以返回数据

func FailWithResult

func FailWithResult(c *gin.Context, result types2.Result, args ...types2.RespOpt)

func InvalidRequest

func InvalidRequest(c *gin.Context, message string)

InvalidRequest 无效入参, 状态码400

func InvalidRequestWithData

func InvalidRequestWithData(c *gin.Context, message string, data interface{})

InvalidRequestWithData 与InvalidRequest功能一致, 但是可以返回数据

func Success

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

Success 业务正常运行, 状态码200

Types

This section is empty.

Jump to

Keyboard shortcuts

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