app

package
v0.0.0-...-32702a7 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPathParameterInt

func GetPathParameterInt(context *gin.Context, args ...string) (map[string]int, error)

GetPathParameterInt 获取请求路径上的id参数

func GetPathParameterString

func GetPathParameterString(context *gin.Context, args ...string) (map[string]string, error)

func HandleNotFound

func HandleNotFound(c *gin.Context)

func HandleNotMethod

func HandleNotMethod(c *gin.Context)

func InitTrans

func InitTrans(locale string) (err error)

InitTrans 初始化翻译器

func Setup

func Setup()

Types

type Gin

type Gin struct {
	C *gin.Context
}

func (*Gin) Fail

func (g *Gin) Fail(httpCode int, err error, data interface{})

func (*Gin) Success

func (g *Gin) Success(httpCode int, msg string, data interface{})

Response setting gin.JSON

func (*Gin) SuccessExtra

func (g *Gin) SuccessExtra(total int64, page int, pageSize, httpCode int, msg string, data interface{})

type Response

type Response struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type ResponseExtra

type ResponseExtra struct {
	Total    int64 `json:"total"`
	Page     int   `json:"page"`
	PageSize int   `json:"pageSize"`
	Response
}

Jump to

Keyboard shortcuts

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