http

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ReqDataKey = "req_data"

Variables

This section is empty.

Functions

func CommonErrorCodeResponse

func CommonErrorCodeResponse(c *gin.Context, code int, err error)

func CommonErrorResponse

func CommonErrorResponse(c *gin.Context, err error)

func CommonFailCodeResponse

func CommonFailCodeResponse(c *gin.Context, code int, err string)

func CommonFailResponse

func CommonFailResponse(c *gin.Context, err string)

func CommonSuccessPageResponse

func CommonSuccessPageResponse(c *gin.Context, total int, items []interface{})

func CommonSuccessResponse

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

func GetBody

func GetBody(ctx *gin.Context, v interface{}) error

func NewTableData

func NewTableData(data interface{}, pageNo, pageSize, count int) (td *types.TableData)

Types

type HttpResult

type HttpResult struct {
	Code    int         `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

func CommonErrResult

func CommonErrResult(err error) HttpResult

func CommonFailResult

func CommonFailResult(err string) HttpResult

func CommonSuccessPageResult

func CommonSuccessPageResult(total int, items []interface{}) HttpResult

func CommonSuccessResult

func CommonSuccessResult(data interface{}) HttpResult

Jump to

Keyboard shortcuts

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