server

package
v0.0.0-...-04c1826 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS_CODE  = 200  // 成功
	INVALID_PARAM = 499  // 参数错误
	SYS_ERROR     = 500  // 系统错误
	JWT_FAIL      = 4001 // JWT错误
)
View Source
const (
	REGISTER_TTL      = 15 //重新注册时间
	REGISTER_INTERVAL = 10 //注册过期时间
)

Variables

This section is empty.

Functions

func InitHTTP

func InitHTTP(conf *config.Conf, handler *gin.Engine)

func NewHTTP

func NewHTTP() *gin.Engine

func RespBusiness

func RespBusiness(c *gin.Context, code int, msg string)

func RespInvalidParam

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

func RespSuccess

func RespSuccess(c *gin.Context)

func RespSuccessMsg

func RespSuccessMsg(c *gin.Context, obj interface{})

func RespSysError

func RespSysError(c *gin.Context)

Types

type ApiResult

type ApiResult struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

type RespModel

type RespModel struct {
	ApiResult
	Data interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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