ginplus

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIDKey        = prefix + "/user-id"
	ReqBodyKey       = prefix + "/req-body"
	ResBodyKey       = prefix + "/res-body"
	LoggerReqBodyKey = prefix + "/logger-req-body"
	AppIDKEY         = prefix + "/app-id"
)

定义上下文中的键

Variables

This section is empty.

Functions

func GetAppId

func GetAppId(c *gin.Context) string

func GetBody

func GetBody(c *gin.Context) []byte

GetBody Get request body

func GetDefaultAppId

func GetDefaultAppId() string

func GetDefaultAppName added in v1.0.1

func GetDefaultAppName() string

func GetScopeAppId

func GetScopeAppId(c *gin.Context) string

获取当前执行环境下的app_id

func GetTableWithPrefix

func GetTableWithPrefix(defaultTableName string) string

func GetToken

func GetToken(c *gin.Context) string

GetToken 获取用户令牌

func GetUserID

func GetUserID(c *gin.Context) string

GetUserID 获取用户ID

func ParseForm

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

ParseForm 解析Form请求

func ParseJSON

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

ParseJSON 解析请求JSON

func ParseQuery

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

ParseQuery 解析Query参数

func ResCustomError

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

响应自定义失败

func ResCustomSuccess

func ResCustomSuccess(c *gin.Context, v interface{})

响应自定义成功

func ResError

func ResError(c *gin.Context, err error, status ...int)

ResError 响应错误

func ResJSON

func ResJSON(c *gin.Context, status int, v interface{})

ResJSON 响应JSON数据

func ResList

func ResList(c *gin.Context, v interface{})

ResList 响应列表数据

func ResOK

func ResOK(c *gin.Context)

ResOK 响应OK

func ResPage

func ResPage(c *gin.Context, v interface{}, pr *schema.PaginationResult)

ResPage 响应分页数据

func ResSuccess

func ResSuccess(c *gin.Context, v interface{})

ResSuccess 响应成功

func SetAppID

func SetAppID(c *gin.Context, appID string)

func SetTablePrefix

func SetTablePrefix(vals ...string)

func SetUserID

func SetUserID(c *gin.Context, userID string)

SetUserID 设定用户ID

Types

This section is empty.

Jump to

Keyboard shortcuts

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