mirror of
https://github.com/PengZhangs2017582/novel.git
synced 2025-06-24 19:21:32 +08:00
initial commit
This commit is contained in:
22
internal/model/context.go
Normal file
22
internal/model/context.go
Normal file
@ -0,0 +1,22 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
// Context 请求上下文结构
|
||||
type Context struct {
|
||||
Session *ghttp.Session // 当前Session管理对象
|
||||
User *ContextUser // 上下文用户信息
|
||||
Data g.Map // 自定KV变量,业务模块根据需要设置,不固定
|
||||
}
|
||||
|
||||
// ContextUser 请求上下文中的用户信息
|
||||
type ContextUser struct {
|
||||
Id uint // 用户ID
|
||||
// Name string // 用户账号
|
||||
// //Nickname string // 用户名称
|
||||
// //Avatar string // 用户头像
|
||||
// IsAdmin uint8 // 是否是管理员
|
||||
}
|
Reference in New Issue
Block a user