http

package
v0.0.0-...-ea68c78 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenCommonResponse

func GenCommonResponse(ctx *gin.Context, retCode RetCode, data interface{}, message string)

func GetUrl

func GetUrl(address string, path string, param ...interface{}) string

Types

type CommonResponse

type CommonResponse struct {
	RetCode RetCode     `json:"ret_code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

type RetCode

type RetCode int
const (
	RetCodeOk RetCode = 0

	// 1xxx为请求相关错误
	RetCodeInvalidRequest RetCode = 1000
	RetCodeBadRequest     RetCode = 1001

	// 2xxx为业务内部处理相关错误
	RetCodeInternalErr RetCode = 2000
)

type RouterSchema

type RouterSchema interface {
	RegisterSchema(router *gin.Engine)
}

Jump to

Keyboard shortcuts

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