Back to godoc.org

Package context

v1.1.0
Latest Go to latest

The latest major version is .

Published: Dec 5, 2018 | License: MIT | Module: github.com/1920853199/gin-admin

Index

func WrapContext

func WrapContext(ctx func(*Context), memo ...string) gin.HandlerFunc

WrapContext 包装上下文

type Context

type Context struct {
	*gin.Context
}

Context 定义上下文

func NewContext

func NewContext(c *gin.Context) *Context

NewContext 创建上下文实例

func (*Context) GetPageIndex

func (a *Context) GetPageIndex() uint

GetPageIndex 获取分页的页索引

func (*Context) GetPageSize

func (a *Context) GetPageSize() uint

GetPageSize 获取分页的页大小

func (*Context) GetTraceID

func (a *Context) GetTraceID() string

GetTraceID 获取追踪ID

func (*Context) GetUserID

func (a *Context) GetUserID() string

GetUserID 获取当前用户ID

func (*Context) NewContext

func (a *Context) NewContext() context.Context

NewContext 创建上下文实例

func (*Context) ParseJSON

func (a *Context) ParseJSON(obj interface{}) error

ParseJSON 解析请求JSON

func (*Context) ResBadRequest

func (a *Context) ResBadRequest(err error, code ...int)

ResBadRequest 响应客户端请求错误

func (*Context) ResError

func (a *Context) ResError(err error, status int, code ...int)

ResError 响应错误

func (*Context) ResInternalServerError

func (a *Context) ResInternalServerError(err error, code ...int)

ResInternalServerError 响应服务器错误

func (*Context) ResList

func (a *Context) ResList(list interface{})

ResList 响应列表数据

func (*Context) ResOK

func (a *Context) ResOK()

ResOK 响应OK

func (*Context) ResPage

func (a *Context) ResPage(total int64, list interface{})

ResPage 响应分页数据

func (*Context) ResSuccess

func (a *Context) ResSuccess(obj interface{})

ResSuccess 响应成功

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier