beanctx

package
v0.0.0-...-fff97c9 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserInfoKey = "user_info"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BizContext

type BizContext struct {
	*gin.Context
	// contains filtered or unexported fields
}

BizContext 扩展gin.Context

func NewContext

func NewContext(c *gin.Context) *BizContext

func (BizContext) GetAppId

func (m BizContext) GetAppId() string

func (*BizContext) GetDb

func (b *BizContext) GetDb() *gorm.DB

func (BizContext) GetOpenid

func (m BizContext) GetOpenid() string

func (*BizContext) GetReqParam

func (b *BizContext) GetReqParam() interface{}

GetReqParam 获取解析&校验后的参数

func (*BizContext) Log

func (b *BizContext) Log() *beanlog.BeanLogger

func (*BizContext) ParseRequest

func (b *BizContext) ParseRequest(req interface{}) *beanerr.BizError

func (*BizContext) RunInTransaction

func (b *BizContext) RunInTransaction(fn func() error) error

RunInTransaction 不支持嵌套事务

type JwtClaims

type JwtClaims struct {
	jwt.RegisteredClaims `json:"-"`
	UserInfo
}

type UserInfo

type UserInfo struct {
	Openid *string
	AppId  *string
}

Jump to

Keyboard shortcuts

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