Documentation ¶
Index ¶
- Variables
- func DynamicRespErr(c *gin.Context, err error)
- func RespError(ctx *gin.Context, c code.MyCode)
- func RespErrorInvalidParams(ctx *gin.Context, err error)
- func RespErrorWithMsg(ctx *gin.Context, code code.MyCode, errMsg string)
- func RespGrpcErrorWithMsg(ctx *gin.Context, code code.MyCode, err error)
- func RespSuccess(ctx *gin.Context, data interface{})
- func RespSuccessPagination(ctx *gin.Context, pageIndex, pageSize int, total int64, data interface{})
- func RespSuccessWithMsg(ctx *gin.Context, data interface{}, msg string)
- type PaginateResp
- type RespData
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyData struct{}
Functions ¶
func DynamicRespErr ¶ added in v0.6.2
DynamicRespErr 自适应返回,error 是定义的就按定义的返回,否则按 500 返回并返回 err 的内容
func RespErrorInvalidParams ¶
RespErrorInvalidParams 参数校验不通过(gin should bind)
func RespGrpcErrorWithMsg ¶
func RespSuccess ¶
func RespSuccessPagination ¶
func RespSuccessPagination(ctx *gin.Context, pageIndex, pageSize int, total int64, data interface{})
RespSuccessPagination 分页数据返回
func RespSuccessWithMsg ¶
Types ¶
type PaginateResp ¶
Click to show internal directories.
Click to hide internal directories.