Files
req/user.go
T
what 1868c8dd15 重构: User 相关类型拆分出 user_accessor.go/user_runtime.go
UserAccessor、UserRuntime 从 user.go 拆成独立文件,user.go 只保留 User 接口本身。
2026-07-22 09:11:26 +08:00

22 lines
371 B
Go
Executable File

package req
type User interface {
Runtime() UserRuntime
// 用户ID
ID() int64
// 用户UUID
Uuid() string
// 用户名称
Username() string
// 用户昵称
Nickname() string
// 用户明细
GetUserInfo() map[string]any
// 用户权限
Roles() []string
// 用户权限检查
HasUserRoles(roles ...string) bool
// 是否匿名用户
IsAnonymous() bool
}