Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Access ¶ added in v0.6.7
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 uint16 `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:'撤销时间'"` // 撤销时间
}
权限控制
func (Access) FindAll ¶ added in v0.6.7
func (m Access) FindAll(filters ...base.FilterFunc) (objs []*Access, err error)
查询符合条件的所有行
type Group ¶ added in v0.6.7
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:"-" gorm:"comment:'创建时间'"` // 创建时间
}
用户组
func (Group) FindAll ¶ added in v0.6.7
func (m Group) FindAll(filters ...base.FilterFunc) (objs []*Group, err error)
查询符合条件的所有行
type Menu ¶ added in v0.6.7
type Menu struct {
BaseModel
*base.NestedModel
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:'说明备注'"` //说明备注
base.TimeModel
}
菜单
func (Menu) FindAll ¶ added in v0.6.7
func (m Menu) FindAll(filters ...base.FilterFunc) (objs []*Menu, err error)
查询符合条件的所有行
type Role ¶ added in v0.6.7
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:'说明备注'"` //说明备注
base.TimeModel
}
角色
func (Role) FindAll ¶ added in v0.6.7
func (m Role) FindAll(filters ...base.FilterFunc) (objs []*Role, err error)
查询符合条件的所有行
type User ¶ added in v0.6.7
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:'介绍说明'"` //介绍说明
base.TimeModel
}
用户
func (User) FindAll ¶ added in v0.6.7
func (m User) FindAll(filters ...base.FilterFunc) (objs []*User, err error)
查询符合条件的所有行
type UserRole ¶ added in v0.6.7
type UserRole struct {
BaseModel
UserUID string `json:"user_uid" gorm:"type:char(16);not null;index;default:'';comment:'用户ID'"` // 用户ID
RoleName string `json:"role_name" gorm:"size:50;not null;index;default:'';comment:'角色名'"` // 角色名
}
用户角色
func (UserRole) FindAll ¶ added in v0.6.7
func (m UserRole) FindAll(filters ...base.FilterFunc) (objs []*UserRole, err error)
查询符合条件的所有行
Click to show internal directories.
Click to hide internal directories.