Documentation ¶
Index ¶
- Constants
- type BizContext
- func (m BizContext) GetAppId() string
- func (b *BizContext) GetDb() *gorm.DB
- func (m BizContext) GetOpenid() string
- func (b *BizContext) GetReqParam() interface{}
- func (b *BizContext) Log() *beanlog.BeanLogger
- func (b *BizContext) ParseRequest(req interface{}) *beanerr.BizError
- func (b *BizContext) RunInTransaction(fn func() error) error
- type JwtClaims
- type UserInfo
Constants ¶
View Source
const (
UserInfoKey = "user_info"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BizContext ¶
BizContext 扩展gin.Context
func NewContext ¶
func NewContext(c *gin.Context) *BizContext
func (*BizContext) GetDb ¶
func (b *BizContext) GetDb() *gorm.DB
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 不支持嵌套事务
Click to show internal directories.
Click to hide internal directories.