rbac

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

README

Documentation

Overview

*

  • Copyright (C) 2009-2024 56X.NET, All rights reserved. *
  • name : model_gen.go
  • author : jarrysix
  • date : 2021/07/15 13:44:47
  • description : RBAC实体
  • history :

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IRbacAggregateRoot

type IRbacAggregateRoot interface {
	domain.IAggregateRoot
	// GetUser 获取用户
	GetUser(userId int) IRbacUser
}

IRbacAggregateRoot 权限聚合根

type IRbacRepository

type IRbacRepository interface {
	// GetRbacAggregateRoot 获取权限聚合根
	GetRbacAggregateRoot() IRbacAggregateRoot
	// UserRepo 用户仓储
	UserRepo() fw.Repository[RbacUser]
	// UserRoleRepo 用户绑定角色仓储
	UserRoleRepo() fw.Repository[RbacUserRole]
	// LoginLogRepo 登陆日志
	LoginLogRepo() fw.Repository[RbacLoginLog]
}

IRbacRepository 权限仓储

type IRbacUser

type IRbacUser interface {
	domain.IDomain
	// GetValue 获取用户信息
	GetValue() RbacUser
	// GetRoles 获取用户角色
	GetRoles() []int
}

IRbacUser 用户

type RbacDepart

type RbacDepart struct {
	// ID
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 名称
	Name string `json:"name" db:"name" gorm:"column:name" bson:"name"`
	// 上级部门
	Pid int `json:"pid" db:"pid" gorm:"column:pid" bson:"pid"`
	// 状态
	Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
	// 部门代码
	Code string `json:"code" db:"code" gorm:"column:code" bson:"code"`
}

RbacDepart 部门

func (RbacDepart) TableName

func (r RbacDepart) TableName() string

type RbacDict

type RbacDict struct {
	// Id
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 字典名称
	Name string `json:"name" db:"name" gorm:"column:name" bson:"name"`
	// 描述
	Remark string `json:"remark" db:"remark" gorm:"column:remark" bson:"remark"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
}

RbacDict 数据字典

func (RbacDict) TableName

func (r RbacDict) TableName() string

type RbacDictDetail

type RbacDictDetail struct {
	// Id
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 字典标签
	Label string `json:"label" db:"label" gorm:"column:label" bson:"label"`
	// 字典值
	Value string `json:"value" db:"value" gorm:"column:value" bson:"value"`
	// 排序
	Sort string `json:"sort" db:"sort" gorm:"column:sort" bson:"sort"`
	// 字典id
	DictId int `json:"dictId" db:"dict_id" gorm:"column:dict_id" bson:"dictId"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
}

RbacDictDetail 数据字典详情

func (RbacDictDetail) TableName

func (r RbacDictDetail) TableName() string

type RbacJob

type RbacJob struct {
	// ID
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 岗位名称
	Name string `json:"name" db:"name" gorm:"column:name" bson:"name"`
	// 岗位状态
	Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"`
	// 岗位排序
	Sort int `json:"sort" db:"sort" gorm:"column:sort" bson:"sort"`
	// 部门ID
	DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
}

RbacJob 岗位

func (RbacJob) TableName

func (r RbacJob) TableName() string

type RbacLoginLog

type RbacLoginLog struct {
	// 编号
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 用户编号
	UserId int `json:"userId" db:"user_id" gorm:"column:user_id" bson:"userId"`
	// 登录IP地址
	Ip string `json:"ip" db:"ip" gorm:"column:ip" bson:"ip"`
	// 是否成功
	IsSuccess int `json:"isSuccess" db:"is_success" gorm:"column:is_success" bson:"isSuccess"`
	// 创建时间
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
}

RbacLoginLog 用户登录日志

func (RbacLoginLog) TableName

func (r RbacLoginLog) TableName() string

type RbacRes

type RbacRes struct {
	// 资源ID
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 资源名称
	Name string `json:"name" db:"name" gorm:"column:name" bson:"name"`
	// 资源类型, 0: 目录 1: 资源 2: 菜单  3:  按钮
	ResType int `json:"resType" db:"res_type" gorm:"column:res_type" bson:"resType"`
	// 上级菜单ID
	Pid int `json:"pid" db:"pid" gorm:"column:pid" bson:"pid"`
	// 资源键
	ResKey string `json:"resKey" db:"res_key" gorm:"column:res_key" bson:"resKey"`
	// 资源路径
	Path string `json:"path" db:"path" gorm:"column:path" bson:"path"`
	// 图标
	Icon string `json:"icon" db:"icon" gorm:"column:icon" bson:"icon"`
	// 排序
	SortNum int `json:"sortNum" db:"sort_num" gorm:"column:sort_num" bson:"sortNum"`
	// 是否显示到菜单中
	IsMenu int `json:"isMenu" db:"is_menu" gorm:"column:is_menu" bson:"isMenu"`
	// 是否启用
	IsEnabled int `json:"isEnabled" db:"is_enabled" gorm:"column:is_enabled" bson:"isEnabled"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
	// 深度/层级
	Depth int `json:"depth" db:"depth" gorm:"column:depth" bson:"depth"`
	// 是否禁止
	IsForbidden int `json:"isForbidden" db:"is_forbidden" gorm:"column:is_forbidden" bson:"isForbidden"`
	// 应用(系统)序号
	AppIndex int `json:"appIndex" db:"app_index" gorm:"column:app_index" bson:"appIndex"`
}

RbacRes RbacRes

func (RbacRes) TableName

func (r RbacRes) TableName() string

type RbacRole

type RbacRole struct {
	// ID
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 名称
	Name string `json:"name" db:"name" gorm:"column:name" bson:"name"`
	// 角色级别
	Level int `json:"level" db:"level" gorm:"column:level" bson:"level"`
	// 数据权限
	DataScope string `json:"dataScope" db:"data_scope" gorm:"column:data_scope" bson:"dataScope"`
	// 备注
	Remark string `json:"remark" db:"remark" gorm:"column:remark" bson:"remark"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
	// 角色代码
	Code string `json:"code" db:"code" gorm:"column:code" bson:"code"`
}

RbacRole 角色

func (RbacRole) TableName

func (r RbacRole) TableName() string

type RbacRoleDept

type RbacRoleDept struct {
	// 编号
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 角色编号
	RoleId int `json:"roleId" db:"role_id" gorm:"column:role_id" bson:"roleId"`
	// 部门编号
	DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"`
}

RbacRoleDept 角色部门关联

func (RbacRoleDept) TableName

func (r RbacRoleDept) TableName() string

type RbacRoleRes

type RbacRoleRes struct {
	// 编号
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 菜单ID
	ResId int `json:"resId" db:"res_id" gorm:"column:res_id" bson:"resId"`
	// 角色ID
	RoleId int `json:"roleId" db:"role_id" gorm:"column:role_id" bson:"roleId"`
	// 权限值, 1:增加  2:删除 4: 更新
	PermFlag int `json:"permFlag" db:"perm_flag" gorm:"column:perm_flag" bson:"permFlag"`
}

RbacRoleRes 角色菜单关联

func (RbacRoleRes) TableName

func (r RbacRoleRes) TableName() string

type RbacUser

type RbacUser struct {
	// ID
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 用户名
	Username string `json:"username" db:"username" gorm:"column:username" bson:"username"`
	// 密码
	Password string `json:"password" db:"password" gorm:"column:password" bson:"password"`
	// 加密盐
	Salt string `json:"salt" db:"salt" gorm:"column:salt" bson:"salt"`
	// 标志
	Flag int `json:"flag" db:"flag" gorm:"column:flag" bson:"flag"`
	// 头像
	ProfilePhoto string `json:"profilePhoto" db:"profile_photo" gorm:"column:profile_photo" bson:"profilePhoto"`
	// 姓名
	Nickname string `json:"nickname" db:"nickname" gorm:"column:nickname" bson:"nickname"`
	// 性别
	Gender int `json:"gender" db:"gender" gorm:"column:gender" bson:"gender"`
	// 邮箱
	Email string `json:"email" db:"email" gorm:"column:email" bson:"email"`
	// 手机号码
	Phone string `json:"phone" db:"phone" gorm:"column:phone" bson:"phone"`
	// 部门编号
	DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"`
	// 岗位编号
	JobId int `json:"jobId" db:"job_id" gorm:"column:job_id" bson:"jobId"`
	// 状态:1启用、0禁用
	Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"`
	// 最后登录的日期
	LastLogin int `json:"lastLogin" db:"last_login" gorm:"column:last_login" bson:"lastLogin"`
	// 创建日期
	CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"`
}

RbacUser 系统用户

func (RbacUser) TableName

func (r RbacUser) TableName() string

type RbacUserRole

type RbacUserRole struct {
	// 编号
	Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"`
	// 用户ID
	UserId int `json:"userId" db:"user_id" gorm:"column:user_id" bson:"userId"`
	// 角色ID
	RoleId int `json:"roleId" db:"role_id" gorm:"column:role_id" bson:"roleId"`
}

RbacUserRole 用户角色关联

func (RbacUserRole) TableName

func (r RbacUserRole) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL