Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Access ¶ added in v0.6.3
type Access struct {
BaseModel
RoleName string `json:"role_name" gorm:"size:50;not null;index;default:'';comment:'角色名'"` // 角色名
ResourceType string `json:"resource_type" gorm:"size:50;not null;default:'';comment:'资源类型'"` // 资源类型
ResourceArgs *string `json:"resource_args" gorm:"comment:'资源参数'"` // 资源参数
PermCode uint `json:"perm_code" gorm:"not null;default:'0';comment:'权限码'"` // 权限码
Actions string `json:"actions" gorm:"size:50;not null;default:'';comment:'允许的操作'"` // 允许的操作
GrantedAt *time.Time `json:"granted_at" gorm:"comment:'授权时间'"` // 授权时间
RevokedAt *time.Time `json:"revoked_at" gorm:"index;comment:'撤销时间'"` // 撤销时间
}
权限控制
type Group ¶
type Group struct {
BaseModel
GID string `json:"gid" gorm:"unique_index;type:char(16);not null;default:'';comment:'唯一ID';column:gid"` // 唯一ID
Title string `json:"title" gorm:"size:50;not null;default:'';comment:'名称'"` // 名称
Remark *string `json:"remark" gorm:"type:text;comment:'说明备注'"` // 说明备注
CreatedAt time.Time `json:"CreatedAt" gorm:"comment:'创建时间'"` // 创建时间
}
用户组
type Menu ¶
type Menu struct {
BaseModel
Lft uint `json:"lft" gorm:"not null;default:'0';comment:'左边界'"` // 左边界
Rgt uint `json:"rgt" gorm:"not null;index;default:'0';comment:'右边界'"` // 右边界
Depth uint8 `json:"depth" gorm:"not null;index;default:'1';comment:'高度'"` // 高度
Path string `json:"path" gorm:"size:100;not null;index;default:'';comment:'路径'"` // 路径
Title string `json:"title" gorm:"size:50;not null;default:'';comment:'名称'"` // 名称
Icon *string `json:"icon" gorm:"size:30;comment:'图标'"` // 图标
Remark *string `json:"remark" gorm:"type:text;comment:'说明备注'"` // 说明备注
CreatedAt time.Time `json:"CreatedAt" gorm:"comment:'创建时间'"` // 创建时间
UpdatedAt time.Time `json:"UpdatedAt" gorm:"comment:'更新时间'"` // 更新时间
DeletedAt *time.Time `json:"DeletedAt" gorm:"index;comment:'删除时间'"` // 删除时间
}
菜单
type Role ¶
type Role struct {
BaseModel
Name string `json:"name" gorm:"unique_index;size:50;not null;default:'';comment:'名称'"` // 名称
Remark *string `json:"remark" gorm:"type:text;comment:'说明备注'"` // 说明备注
CreatedAt time.Time `json:"CreatedAt" gorm:"comment:'创建时间'"` // 创建时间
UpdatedAt time.Time `json:"UpdatedAt" gorm:"comment:'更新时间'"` // 更新时间
DeletedAt *time.Time `json:"DeletedAt" gorm:"index;comment:'删除时间'"` // 删除时间
}
角色
type User ¶
type User struct {
BaseModel
UID string `json:"uid" gorm:"unique_index;type:char(16);not null;default:'';comment:'唯一ID'"` // 唯一ID
Username string `json:"username" gorm:"size:30;not null;index;default:'';comment:'用户名'"` // 用户名
Password string `json:"-" gorm:"size:60;not null;default:'';comment:'密码'"` // 密码
Realname *string `json:"realname" gorm:"size:20;comment:'昵称/称呼'"` // 昵称/称呼
Mobile *string `json:"mobile" gorm:"size:20;index;comment:'手机号码'"` // 手机号码
Email *string `json:"email" gorm:"size:50;comment:'电子邮箱'"` // 电子邮箱
PrinGid string `json:"prin_gid" gorm:"type:char(16);not null;default:'';comment:'主用户组'"` // 主用户组
ViceGid *string `json:"vice_gid" gorm:"type:char(16);comment:'次用户组'"` // 次用户组
Avatar *string `json:"avatar" gorm:"size:100;comment:'头像'"` // 头像
Introduction *string `json:"introduction" gorm:"size:500;comment:'介绍说明'"` // 介绍说明
CreatedAt time.Time `json:"CreatedAt" gorm:"comment:'创建时间'"` // 创建时间
UpdatedAt time.Time `json:"UpdatedAt" gorm:"comment:'更新时间'"` // 更新时间
DeletedAt *time.Time `json:"DeletedAt" gorm:"index;comment:'删除时间'"` // 删除时间
}
用户
Click to show internal directories.
Click to hide internal directories.