system

package
v0.0.0-...-c9be414 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	gorm.Model
	Method   string `gorm:"type:varchar(20);comment:'请求方式'" json:"method"`
	Path     string `gorm:"type:varchar(100);comment:'访问路径'" json:"path"`
	Category string `gorm:"type:varchar(50);comment:'所属类别'" json:"category"`
	Remark   string `gorm:"type:varchar(100);comment:'备注'" json:"remark"`
	Creator  string `gorm:"type:varchar(20);comment:'创建人'" json:"creator"`
}

type Group

type Group struct {
	gorm.Model
	GroupName string   `gorm:"type:varchar(128);comment:'分组名称'" json:"groupName"`
	Remark    string   `gorm:"type:varchar(128);comment:'分组中文说明'" json:"remark"`
	Creator   string   `gorm:"type:varchar(20);comment:'创建人'" json:"creator"`
	Users     []*User  `gorm:"many2many:group_users" json:"users"`
	ParentId  uint     `gorm:"default:0;comment:'父组编号(编号为0时表示根组)'" json:"parentId"`
	Source    string   `gorm:"type:varchar(20);comment:'来源:dingTalk、weCom、ldap、platform'" json:"source"`
	Children  []*Group `gorm:"-" json:"children"`
}
type Menu struct {
	gorm.Model
	Name       string  `gorm:"type:varchar(50);comment:'菜单名称(英文名, 可用于国际化)'" json:"name"`
	Title      string  `gorm:"type:varchar(50);comment:'菜单标题(无法国际化时使用)'" json:"title"`
	Icon       string  `gorm:"type:varchar(50);comment:'菜单图标'" json:"icon"`
	Path       string  `gorm:"type:varchar(100);comment:'菜单访问路径'" json:"path"`
	Redirect   string  `gorm:"type:varchar(100);comment:'重定向路径'" json:"redirect"`
	Component  string  `gorm:"type:varchar(100);comment:'前端组件路径'" json:"component"`
	Sort       uint    `gorm:"type:int(3);default:999;comment:'菜单顺序(1-999)'" json:"sort"`
	Status     uint    `gorm:"type:tinyint(1);default:1;comment:'菜单状态(正常/禁用, 默认正常)'" json:"status"`
	Hidden     uint    `gorm:"type:tinyint(1);default:2;comment:'菜单在侧边栏隐藏(1隐藏,2显示)'" json:"hidden"`
	NoCache    uint    `gorm:"type:tinyint(1);default:2;comment:'菜单是否被 <keep-alive> 缓存(1不缓存,2缓存)'" json:"noCache"`
	AlwaysShow uint    `` /* 134-byte string literal not displayed */
	Breadcrumb uint    `gorm:"type:tinyint(1);default:1;comment:'面包屑可见性(可见/隐藏, 默认可见)'" json:"breadcrumb"`
	ActiveMenu string  `gorm:"type:varchar(100);comment:'在其它路由时,想在侧边栏高亮的路由'" json:"activeMenu"`
	ParentId   uint    `gorm:"default:0;comment:'父菜单编号(编号为0时表示根菜单)'" json:"parentId"`
	Creator    string  `gorm:"type:varchar(20);comment:'创建人'" json:"creator"`
	Children   []*Menu `gorm:"-" json:"children"`                  // 子菜单集合
	Roles      []*Role `gorm:"many2many:role_menus;" json:"roles"` // 角色菜单多对多关系
}

type OperationLog

type OperationLog struct {
	gorm.Model
	Username   string `gorm:"type:varchar(20);comment:'用户登录名'" json:"username"`
	Ip         string `gorm:"type:varchar(20);comment:'Ip地址'" json:"ip"`
	IpLocation string `gorm:"type:varchar(20);comment:'Ip所在地'" json:"ipLocation"`
	Method     string `gorm:"type:varchar(20);comment:'请求方式'" json:"method"`
	Path       string `gorm:"type:varchar(100);comment:'访问路径'" json:"path"`
	Remark     string `gorm:"type:varchar(100);comment:'备注'" json:"remark"`
	Status     int    `gorm:"type:int(4);comment:'响应状态码'" json:"status"`
	StartTime  string `gorm:"type:varchar(2048);comment:'发起时间'" json:"startTime"`
	TimeCost   int64  `gorm:"type:int(6);comment:'请求耗时(ms)'" json:"timeCost"`
	UserAgent  string `gorm:"type:varchar(2048);comment:'浏览器标识'" json:"userAgent"`
}

type Role

type Role struct {
	gorm.Model
	Name    string  `gorm:"type:varchar(20);not null;unique" json:"name"`
	Keyword string  `gorm:"type:varchar(20);not null;unique" json:"keyword"`
	Remark  string  `gorm:"type:varchar(100);comment:'备注'" json:"remark"`
	Status  uint    `gorm:"type:tinyint(1);default:1;comment:'1正常, 2禁用'" json:"status"`
	Sort    uint    `` /* 200-byte string literal not displayed */
	Creator string  `gorm:"type:varchar(20);" json:"creator"`
	Users   []*User `gorm:"many2many:user_roles" json:"users"`
	Menus   []*Menu `gorm:"many2many:role_menus;" json:"menus"` // 角色菜单多对多关系
}

type RoleCasbin

type RoleCasbin struct {
	Keyword string `json:"keyword"` // 角色关键字
	Path    string `json:"path"`    // 访问路径
	Method  string `json:"method"`  // 请求方式
}

角色权限规则

type User

type User struct {
	gorm.Model
	Username      string  `gorm:"type:varchar(50);not null;unique;comment:'用户名'" json:"username"`                    // 用户名
	Password      string  `gorm:"size:255;not null;comment:'用户密码'" json:"password"`                                  // 用户密码
	Nickname      string  `gorm:"type:varchar(50);comment:'中文名'" json:"nickname"`                                    // 昵称
	GivenName     string  `gorm:"type:varchar(50);comment:'花名'" json:"givenName"`                                    // 花名,如果有的话,没有的话用昵称占位
	Mail          string  `gorm:"type:varchar(100);comment:'邮箱'" json:"mail"`                                        // 邮箱
	JobNumber     string  `gorm:"type:varchar(20);comment:'工号'" json:"jobNumber"`                                    // 工号
	Mobile        string  `gorm:"type:varchar(15);not null;unique;comment:'手机号'" json:"mobile"`                      // 手机号
	Avatar        string  `gorm:"type:varchar(255);comment:'头像'" json:"avatar"`                                      // 头像
	PostalAddress string  `gorm:"type:varchar(255);comment:'地址'" json:"postalAddress"`                               // 地址
	Departments   string  `gorm:"type:varchar(128);comment:'部门'" json:"departments"`                                 // 部门
	Position      string  `gorm:"type:varchar(128);comment:'职位'" json:"position"`                                    //  职位
	Introduction  string  `gorm:"type:varchar(255);comment:'个人简介'" json:"introduction"`                              // 个人简介
	Status        uint    `gorm:"type:tinyint(1);default:1;comment:'状态:1在职, 2离职'" json:"status"`                     // 状态
	Creator       string  `gorm:"type:varchar(20);;comment:'创建者'" json:"creator"`                                    // 创建者
	Source        string  `gorm:"type:varchar(50);comment:'用户来源:dingTalk、wecom、feishu、ldap、platform'" json:"source"` // 来源
	DepartmentId  string  `gorm:"type:varchar(100);not null;comment:'部门id'" json:"departmentId"`                     // 部门id
	Roles         []*Role `gorm:"many2many:user_roles" json:"roles"`                                                 // 角色
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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