Documentation
¶
Index ¶
- Constants
- func DataScopes(tableName string, userID int) func(db *gorm.DB) *gorm.DB
- func GetApiMonitorDB(db *gorm.DB) *gorm.DB
- func GetColumnsDB(db *gorm.DB) *gorm.DB
- func GetConfigDB(db *gorm.DB) *gorm.DB
- func GetDeptDB(db *gorm.DB) *gorm.DB
- func GetDictDataDB(db *gorm.DB) *gorm.DB
- func GetDictTypeDB(db *gorm.DB) *gorm.DB
- func GetFileDirDB(db *gorm.DB) *gorm.DB
- func GetFileInfoDB(db *gorm.DB) *gorm.DB
- func GetLoginLogDB(db *gorm.DB) *gorm.DB
- func GetMenuDB(db *gorm.DB) *gorm.DB
- func GetOperLogDB(db *gorm.DB) *gorm.DB
- func GetPostDB(db *gorm.DB) *gorm.DB
- func GetRoleDB(db *gorm.DB) *gorm.DB
- func GetRoleDeptDB(db *gorm.DB) *gorm.DB
- func GetRoleMenuDB(db *gorm.DB) *gorm.DB
- func GetSettingDB(db *gorm.DB) *gorm.DB
- func GetTablesDB(db *gorm.DB) *gorm.DB
- func GetUserDB(db *gorm.DB) *gorm.DB
- type ApiMonitor
- type Columns
- type Config
- func (m *Config) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Config) Create(db *gorm.DB, item Config) error
- func (m *Config) Delete(db *gorm.DB, id int) error
- func (m *Config) Exists(db *gorm.DB, item Config) (bool, error)
- func (m *Config) Get(db *gorm.DB) (*Config, error)
- func (m *Config) Query(db *gorm.DB, params param.ConfigParam) (*pagination.Result, error)
- func (m *Config) Update(db *gorm.DB, item Config) error
- type DBColumns
- type DBTables
- type DataPermission
- type Dept
- func (m *Dept) Create(db *gorm.DB, item *Dept) error
- func (m *Dept) Delete(db *gorm.DB, id int) error
- func (m *Dept) Exists(db *gorm.DB, item Dept) (bool, error)
- func (m *Dept) Get(db *gorm.DB) (*Dept, error)
- func (m *Dept) Query(db *gorm.DB, params param.DeptParam) (*pagination.Result, error)
- func (m *Dept) Update(db *gorm.DB, item Dept) error
- type DeptID
- type DeptIDList
- type DeptLabel
- type DictData
- func (m *DictData) BatchDelete(db *gorm.DB, dictCodes []int) error
- func (m *DictData) Create(db *gorm.DB, item DictData) error
- func (m *DictData) Delete(db *gorm.DB, dictCode int) error
- func (m *DictData) Exists(db *gorm.DB, item DictData) (bool, error)
- func (m *DictData) Get(db *gorm.DB) (*DictData, error)
- func (m *DictData) Query(db *gorm.DB, params param.DictDataParam) (*pagination.Result, error)
- func (m *DictData) Update(db *gorm.DB, item DictData) error
- type DictType
- func (m *DictType) BatchDelete(db *gorm.DB, dictIDs []int) error
- func (m *DictType) Create(db *gorm.DB, item DictType) error
- func (m *DictType) Delete(db *gorm.DB, dictID int) error
- func (m *DictType) Exists(db *gorm.DB, item DictType) (bool, error)
- func (m *DictType) Get(db *gorm.DB) (*DictType, error)
- func (m *DictType) Query(db *gorm.DB, params param.DictTypeParam) (*pagination.Result, error)
- func (m *DictType) Update(db *gorm.DB, item DictType) error
- type FileDir
- func (m *FileDir) BatchDelete(db *gorm.DB, ids []int) error
- func (m *FileDir) Create(db *gorm.DB, item *FileDir) error
- func (m *FileDir) Delete(db *gorm.DB, id int) error
- func (m *FileDir) Get(db *gorm.DB) (*FileDir, error)
- func (m *FileDir) Query(db *gorm.DB, params param.FileDirParam) (*pagination.Result, error)
- func (m *FileDir) Update(db *gorm.DB, item FileDir) error
- type FileInfo
- func (m *FileInfo) BatchDelete(db *gorm.DB, ids []int) error
- func (m *FileInfo) Create(db *gorm.DB, item FileInfo) error
- func (m *FileInfo) Delete(db *gorm.DB, id int) error
- func (m *FileInfo) Get(db *gorm.DB) (*FileInfo, error)
- func (m *FileInfo) Query(db *gorm.DB, params param.FileInfoParam) (*pagination.Result, error)
- func (m *FileInfo) Update(db *gorm.DB, item FileInfo) error
- type Index
- type LoginLog
- func (m *LoginLog) BatchDelete(db *gorm.DB, ids []int) error
- func (m *LoginLog) Create(db *gorm.DB, item LoginLog) error
- func (m *LoginLog) Delete(db *gorm.DB, id int) error
- func (m *LoginLog) Get(db *gorm.DB) (*LoginLog, error)
- func (m *LoginLog) Query(db *gorm.DB, params param.LoginLogParam) (*pagination.Result, error)
- func (m *LoginLog) Update(db *gorm.DB, item LoginLog) error
- type Menu
- func (m *Menu) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Menu) Create(db *gorm.DB, item *Menu) error
- func (m *Menu) Delete(db *gorm.DB, id int) error
- func (m *Menu) Exists(db *gorm.DB, item Menu) (bool, error)
- func (m *Menu) Get(db *gorm.DB) (*Menu, error)
- func (m *Menu) GetGroupMenus(db *gorm.DB, userId int) (map[string]interface{}, error)
- func (m *Menu) GetWithRole(db *gorm.DB, roleName string) ([]Menu, error)
- func (m *Menu) Query(db *gorm.DB, params param.MenuParam) (*pagination.Result, error)
- func (m *Menu) Update(db *gorm.DB, item Menu) error
- type MenuID
- type MenuIDList
- type MenuLabel
- type MenuPath
- type OperLog
- func (m *OperLog) BatchDelete(db *gorm.DB, ids []int) error
- func (m *OperLog) Create(db *gorm.DB, item OperLog) error
- func (m *OperLog) Delete(db *gorm.DB, id int) error
- func (m *OperLog) Get(db *gorm.DB) (*OperLog, error)
- func (m *OperLog) Query(db *gorm.DB, params param.OperLogParam) (*pagination.Result, error)
- func (m *OperLog) Update(db *gorm.DB, item OperLog) error
- type Post
- func (m *Post) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Post) Create(db *gorm.DB, item Post) error
- func (m *Post) Delete(db *gorm.DB, id int) error
- func (m *Post) Exists(db *gorm.DB, item Post) (bool, error)
- func (m *Post) Get(db *gorm.DB) (*Post, error)
- func (m *Post) Query(db *gorm.DB, params param.PostParam) (*pagination.Result, error)
- func (m *Post) Update(db *gorm.DB, item Post) error
- type Role
- func (m *Role) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Role) Create(db *gorm.DB, item *Role) error
- func (m *Role) Delete(db *gorm.DB, id int) error
- func (m *Role) Exists(db *gorm.DB, item Role) (bool, error)
- func (m *Role) Get(db *gorm.DB) (*Role, error)
- func (m *Role) GetWithDept(db *gorm.DB) ([]int, error)
- func (m *Role) GetWithMenu(db *gorm.DB) ([]int, error)
- func (m *Role) Query(db *gorm.DB, params param.RoleParam) (*pagination.Result, error)
- func (m *Role) Update(db *gorm.DB, item Role) error
- type RoleDept
- type RoleMenu
- func (m *RoleMenu) BatchDeleteRoleMenu(db *gorm.DB, IDs []int) error
- func (m *RoleMenu) Create(db *gorm.DB, roleID int, menuID []int) error
- func (m *RoleMenu) Delete(db *gorm.DB) error
- func (m *RoleMenu) DeleteRoleMenu(db *gorm.DB, id int) error
- func (m *RoleMenu) Get(db *gorm.DB) ([]RoleMenu, error)
- func (m *RoleMenu) GetIDs(db *gorm.DB) ([]MenuPath, error)
- func (m *RoleMenu) GetPermissions(db *gorm.DB, roleID int) ([]string, error)
- type Setting
- type TableIndex
- type TableIndexList
- type Tables
- func (m *Tables) BatchDelete(db *gorm.DB, ids []int) error
- func (m *Tables) Create(db *gorm.DB, item *Tables) error
- func (m *Tables) Delete(db *gorm.DB, id int) error
- func (m *Tables) Get(db *gorm.DB) (*Tables, error)
- func (m *Tables) List(db *gorm.DB, tableNames []string) ([]*Tables, error)
- func (m *Tables) Query(db *gorm.DB, params param.TablesParam) (*pagination.Result, error)
- func (m *Tables) Update(db *gorm.DB, item Tables) error
- type User
- func (m *User) BatchDelete(db *gorm.DB, id []int) error
- func (m *User) Create(db *gorm.DB, item User) error
- func (m *User) Delete(db *gorm.DB, id int) error
- func (m *User) Encrypt() (err error)
- func (m *User) Exists(db *gorm.DB, item User) (bool, error)
- func (m *User) Get(db *gorm.DB) (*User, error)
- func (m *User) MemberCountInDept(db *gorm.DB, deptId int) (int64, error)
- func (m *User) MemberCountLinkRole(db *gorm.DB) (int64, error)
- func (m *User) Query(db *gorm.DB, params param.UserParam) (*pagination.Result, error)
- func (m *User) Update(db *gorm.DB, item User) error
- type UserInfo
Constants ¶
const ( // Normal 正常 Normal = iota // Forbidden 禁用 Forbidden )
Variables ¶
This section is empty.
Functions ¶
func DataScopes ¶
DataScopes DataScopes
Types ¶
type ApiMonitor ¶ added in v1.0.17
type ApiMonitor struct {
ID int `json:"id" gorm:"primaryKey;autoIncrement;comment:ID;"`
Method string `json:"method" gorm:"size:32;not null;comment:请求方式;" binding:"required"`
Url string `json:"url" gorm:"size:128;not null;comment:请求路径;" binding:"required"`
SpendTime int `json:"spend_time" gorm:"type:int(11);default:0;not null;comment:请求花费时间;" binding:"required"`
CreatedAt time.Time `json:"created_at" gorm:"type:timestamp;default:CURRENT_TIMESTAMP;not null;comment:请求时间"`
}
func (*ApiMonitor) Create ¶ added in v1.0.17
func (m *ApiMonitor) Create(db *gorm.DB, item ApiMonitor) error
Create 创建数据
func (*ApiMonitor) Get ¶ added in v1.0.17
func (m *ApiMonitor) Get(db *gorm.DB, id int) (*ApiMonitor, error)
Get 根据id查询指定数据
func (*ApiMonitor) Query ¶ added in v1.0.17
func (m *ApiMonitor) Query(db *gorm.DB) ([]ApiMonitor, error)
Query 查询所有数据
type Columns ¶
type Columns struct {
ID int `gorm:"primaryKey;autoIncrement;" json:"id"` // ID
TableID int `gorm:"column:table_id;" json:"tableID"` // 表ID
Name string `gorm:"size:128;" json:"name"` // 列名称
Comment string `gorm:"size:255;default:'';" json:"comment"` // 列备注(注释)
DataType string `gorm:"size:32;default:'';" json:"dataType"` // 数据类型
GoType string `gorm:"size:32;default:'';" json:"goType"` // Go类型
GoField string `gorm:"size:63;default:'';" json:"goField"` // Go字段
JSONField string `gorm:"column:json_field;size:64;" json:"jsonField"` // JSON字段
Pk bool `gorm:"size:1;default:0;" json:"pk"` // 主键(默认: 否;是:1 否:2)
Insert bool `gorm:"size:1;default:0;" json:"insert"` // 新增字段(默认: 否;是:1 否:2;[id create_at update_at delete_at create_by update_by]为否)
Edit bool `gorm:"size:1;default:0;" json:"edit"` // 编辑字段(默认: 否;是:1 否:2;[id create_at update_at delete_at create_by update_by]为否)
List bool `gorm:"size:1;default:0;" json:"list"` // 列表展示字段(默认: 否;是:1 否:2;[id create_at update_at delete_at create_by update_by]为否)
QueryField bool `gorm:"size:1;default:0;" json:"queryField"` // 查询字段(默认: 否;是:1 否:2)
QueryType string `gorm:"size:16;default:'';" json:"queryType"` // 查询方式(默认: "";= > >= < <= != LIKE)
Required bool `gorm:"size:1;default:0;" json:"required"` // 必填项(默认: 否;是:1 否:2;[id create_at update_at delete_at create_by update_by]为否)
HTMLType string `gorm:"column:html_type;size:32;default:'';" json:"htmlType"` // 显示类型(input select radio file textarea)
DictKey string `gorm:"size:128;default:'';" json:"dictKey"` // 字典KEY
FkTable string `gorm:"size:128;default:'';" json:"fkTable"` // 关联表
FkColumn string `gorm:"size:128;default:'';" json:"fkColumn"` // 关联表列
Gorm string `gorm:"size:255;default:'';" json:"gorm"` // ORM映射
Encrypt bool `gorm:"size:1;default:0;" json:"encrypt"` // 加密字段(默认: 否 是:1 否:2)
}
Columns 列表
type Config ¶
type Config struct {
gorm.Model
models.ByModel
ConfigName string `json:"configName" gorm:"type:varchar(128);comment:ConfigName"` // 参数名称
ConfigKey string `json:"configKey" gorm:"type:varchar(128);comment:ConfigKey"` // 参数健名
ConfigValue string `json:"configValue" gorm:"type:varchar(255);comment:ConfigValue"` // 参数键值
ConfigType string `json:"configType" gorm:"type:varchar(64);comment:ConfigType"` // 参数类型
Remark string `json:"remark" gorm:"type:varchar(128);comment:Remark"` // 备注
}
Config 系统参数实体
func (*Config) BatchDelete ¶
BatchDelete 批量删除
func (*Config) Query ¶
func (m *Config) Query(db *gorm.DB, params param.ConfigParam) (*pagination.Result, error)
Query 查询数据
type DBColumns ¶
type DBColumns struct {
TableSchema string `gorm:"column:TABLE_SCHEMA" json:"tableSchema"`
TableName string `gorm:"column:TABLE_NAME" json:"tableName"`
ColumnName string `gorm:"column:COLUMN_NAME" json:"columnName"`
ColumnDefault string `gorm:"column:COLUMN_DEFAULT" json:"columnDefault"`
IsNullable string `gorm:"column:IS_NULLABLE" json:"isNullable"`
DataType string `gorm:"column:DATA_TYPE" json:"dataType"`
CharacterMaximumLength string `gorm:"column:CHARACTER_MAXIMUM_LENGTH" json:"characterMaximumLength"`
CharacterSetName string `gorm:"column:CHARACTER_SET_NAME" json:"characterSetName"`
ColumnType string `gorm:"column:COLUMN_TYPE" json:"columnType"`
ColumnKey string `gorm:"column:COLUMN_KEY" json:"columnKey"`
Extra string `gorm:"column:EXTRA" json:"extra"`
ColumnComment string `gorm:"column:COLUMN_COMMENT" json:"columnComment"`
}
DBColumns 数据库列实体
func (*DBColumns) Query ¶
func (m *DBColumns) Query(db *gorm.DB, params param.DBColumnsParam) (*pagination.Result, error)
Query 查询数据
type DBTables ¶
type DBTables struct {
TableName string `gorm:"column:TABLE_NAME" json:"tableName"`
Engine string `gorm:"column:ENGINE" json:"engine"`
TableRows string `gorm:"column:TABLE_ROWS" json:"tableRows"`
TableCollation string `gorm:"column:TABLE_COLLATION" json:"tableCollation"`
CreateTime string `gorm:"column:CREATE_TIME" json:"createTime"`
UpdateTime string `gorm:"column:UPDATE_TIME" json:"updateTime"`
TableComment string `gorm:"column:TABLE_COMMENT" json:"tableComment"`
}
DBTables 数据库表
func (*DBTables) Query ¶
func (m *DBTables) Query(db *gorm.DB, params param.DBTablesParam) (*pagination.Result, error)
Query 查询数据
type DataPermission ¶
DataPermission 数据权限
func (*DataPermission) GetDataScope ¶
GetDataScope GetDataScope
type Dept ¶
type Dept struct {
ID int `json:"id" gorm:"primaryKey;autoIncrement;"` // 部门编码
ParentID int `json:"parentId" gorm:""` // 上级部门
Path string `json:"path" gorm:"size:255;"` // 部门路径
Name string `json:"name" gorm:"size:128;"` // 部门名称
Seq int `json:"seq" gorm:"index:idx_seq;"` // 排序
Leader string `json:"leader" gorm:"size:128;"` // 负责人
Phone string `json:"phone" gorm:"size:11;"` // 手机
Email string `json:"email" gorm:"size:64;"` // 邮箱
Status int `json:"status" gorm:"type:int(11);"` // 状态
CreateBy int `json:"createBy" gorm:"type:int(11);"`
UpdateBy int `json:"updateBy" gorm:"type:int(11);"`
models.AtModel
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
Children []Dept `json:"children" gorm:"-"`
}
Dept 部门实体
type DeptLabel ¶
type DeptLabel struct {
ID int `gorm:"-" json:"id"`
Label string `gorm:"-" json:"label"`
Children []DeptLabel `gorm:"-" json:"children"`
}
DeptLabel 部门标签
type DictData ¶
type DictData struct {
ID int `gorm:"primaryKey;autoIncrement;" json:"id"` // 字典编码
Seq int `gorm:"index:idx_seq;" json:"seq"` // 显示顺序
Label string `gorm:"size:128;" json:"label"` // 数据标签
Value string `gorm:"size:128;" json:"value"` // 数据键值
DictType string `gorm:"size:64;index:idx_dict_type;" json:"dictType"` // 字典类型
ValueType int `gorm:"type:int(11);default:0;" json:"valueType"` // 数据键值类型; 0:int; 1:string
Status int `gorm:"type:int(11);default:0;" json:"status"` // 状态; 0:正常 1:停用
CreateBy int `gorm:"type:int(11);" json:"createBy"` // 创建人
UpdateBy int `gorm:"type:int(11);" json:"updateBy"` // 更新人
Remark string `gorm:"column:remark;size:255;" json:"remark"` // 备注
models.AtModel
DictValue interface{} `gorm:"-" json:"dictValue"`
Params string `gorm:"-" json:"params"`
DataScope string `gorm:"-" json:"dataScope"`
}
DictData 字典数据实体
func (*DictData) BatchDelete ¶
BatchDelete 批量删除
func (*DictData) Query ¶
func (m *DictData) Query(db *gorm.DB, params param.DictDataParam) (*pagination.Result, error)
Query 查询数据
type DictType ¶
type DictType struct {
ID int `gorm:"primaryKey;autoIncrement;" json:"id"` //字典ID
Name string `gorm:"size:128;" json:"name"` //字典名称
Type string `gorm:"size:128;" json:"type"` //字典类型
Status int `gorm:"type:int(11);" json:"status"` //状态
CreateBy int `gorm:"type:int(11);" json:"createBy"` //创建者
UpdateBy int `gorm:"type:int(11);" json:"updateBy"` //更新者
Remark string `gorm:"size:255;" json:"remark"` //备注
models.AtModel
DataScope string `gorm:"-" json:"dataScope"` //
Params string `gorm:"-" json:"params"` //
}
DictType 字典类型实体
func (*DictType) BatchDelete ¶
BatchDelete 批量删除
func (*DictType) Query ¶
func (m *DictType) Query(db *gorm.DB, params param.DictTypeParam) (*pagination.Result, error)
Query 查询数据
type FileDir ¶
type FileDir struct {
ID int `json:"id"`
Label string `json:"label" gorm:"type:varchar(255);"` // 名称
PID int `json:"pId" gorm:"type:int(11);"` // 父ID
Sort int `json:"sort" gorm:""` // 排序
Path string `json:"path" gorm:"size:255;"` // 路径层级
CreateBy string `json:"createBy" gorm:"type:varchar(128);"` // 创建人
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` // 更新人
models.AtModel
Children []FileDir `json:"children" gorm:"-"`
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
}
FileDir 文件夹实体
func (*FileDir) BatchDelete ¶
BatchDelete 批量删除
func (*FileDir) Query ¶
func (m *FileDir) Query(db *gorm.DB, params param.FileDirParam) (*pagination.Result, error)
Query 查询数据
type FileInfo ¶
type FileInfo struct {
ID int `json:"id"` // id
Type string `json:"type" gorm:"type:varchar(255);"` // 文件类型
Name string `json:"name" gorm:"type:varchar(255);"` // 文件名称
Size string `json:"size" gorm:"type:int(11);"` // 文件大小
PID int `json:"pId" gorm:"type:int(11);"` // 目录ID
Source string `json:"source" gorm:"type:varchar(255);"` // 文件源
URL string `json:"url" gorm:"type:varchar(255);"` // 文件路径
FullURL string `json:"fullUrl" gorm:"type:varchar(255);"` // 文件全路径
CreateBy string `json:"createBy" gorm:"type:varchar(128);"` // 创建人
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` // 编辑人
models.AtModel
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
}
FileInfo 文件信息实体
func (*FileInfo) BatchDelete ¶
BatchDelete 批量删除
func (*FileInfo) Query ¶
func (m *FileInfo) Query(db *gorm.DB, params param.FileInfoParam) (*pagination.Result, error)
Query 查询数据
type Index ¶
type Index struct {
Normal map[string]*TableIndex
Clustered map[string]*TableIndex
}
Index 区分一般索引和聚合索引
type LoginLog ¶
type LoginLog struct {
InfoID int `json:"id" gorm:"primaryKey;autoIncrement;"` // 主键
Username string `json:"username" gorm:"size:128;"` // 用户名
Status string `json:"status" gorm:"size:4;"` // 状态
IPaddr string `json:"ipaddr" gorm:"size:255;"` // ip地址
LoginLocation string `json:"loginLocation" gorm:"size:255;"` // 归属地
Browser string `json:"browser" gorm:"size:255;"` // 浏览器
Os string `json:"os" gorm:"size:255;"` // 系统
Platform string `json:"platform" gorm:"size:255;"` // 固件
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"` // 登录时间
CreateBy string `json:"createBy" gorm:"size:128;"` // 创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` // 更新者
DataScope string `json:"dataScope" gorm:"-"` // 数据
Remark string `json:"remark" gorm:"size:255;"` // 备注
Msg string `json:"msg" gorm:"size:255;"`
Params string `json:"params" gorm:"-"`
models.AtModel
}
LoginLog 登录日志
func (*LoginLog) BatchDelete ¶
BatchDelete 批量删除
func (*LoginLog) Query ¶
func (m *LoginLog) Query(db *gorm.DB, params param.LoginLogParam) (*pagination.Result, error)
Query 查询数据
type Menu ¶
type Menu struct {
MenuID int `json:"id" gorm:"primaryKey;autoIncrement;"` // 菜单ID
MenuName string `json:"menuName" gorm:"size:128;"` // 路由名称; 对应VUE Router中name属性; 菜单类型为目录或菜单时必填
Title string `json:"title" gorm:"size:128;"` // 菜单标题; 必须;
Icon string `json:"icon" gorm:"size:128;"` // 菜单图标
Path string `json:"path" gorm:"size:128;"` // 路由Path; 对应VUE Router中path属性; 菜单类型为目录或菜单时必填
Paths string `json:"paths" gorm:"size:128;"` // 菜单层级
MenuType string `json:"menuType" gorm:"size:1;"` // 菜单类型; 必须; M:目录, C:菜单, F:按钮, A:接口; 例如: M
Action string `json:"action" gorm:"size:16;"` // 请求方式; GET:GET, POST:POST, PUT:PUT, DELETE:DELETE; 菜单类型为接口时必填; 例如: GET
Permission string `json:"permission" gorm:"size:255;"` // 权限标识; 例如: "*:*:*"表示所有权限, "system:user:add"表示用户增加权限
ParentID int `json:"parentId" gorm:"size:11;"` // 上级菜单ID; 必须; 例如: 1
NoCache bool `json:"noCache" gorm:"size:1;"` // 路由缓存; 对应VUE Router中meta下noCache属性
Breadcrumb string `json:"breadcrumb" gorm:"size:255;"` // 导航; 未使用
Component string `json:"component" gorm:"size:255;"` // 组件路径; 对应VUE Router中component属性; 菜单类型为目录或菜单时必填
Sort int `json:"sort" gorm:"size:4;index:idx_sort;"` // 菜单显示顺序; 例如: 1
Visible string `json:"visible" gorm:"size:1;"` // 菜单状态; 0:显示, 1:隐藏; 菜单类型为目录、菜单或接口时需要; 例如: 0
CreateBy string `json:"createBy" gorm:"size:128;"` // 创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` // 更新人
IsFrame string `json:"isFrame" gorm:"size:1;default:0;"` // 外链; 0:是, 1:否; 菜单类型为目录或菜单时需要; 例如: 1
DataScope string `json:"dataScope" gorm:"-"` // 数据权限
Params string `json:"params" gorm:"-"` // 参数
RoleID int `gorm:"-"` // 角色ID
Children []Menu `json:"children" gorm:"-"` // 子菜单
IsSelect bool `json:"is_select" gorm:"-"` // 选中
models.AtModel
}
Menu 菜单实体
func (*Menu) BatchDelete ¶
BatchDelete 批量删除
func (*Menu) GetGroupMenus ¶ added in v1.1.6
func (*Menu) GetWithRole ¶
GetWithRole 查询角色菜单
type MenuLabel ¶
type MenuLabel struct {
ID int `json:"id" gorm:"-"`
Label string `json:"label" gorm:"-"`
Children []MenuLabel `json:"children" gorm:"-"`
}
MenuLabel 菜单标识
type OperLog ¶
type OperLog struct {
OperID int `json:"operId" gorm:"primaryKey;autoIncrement;"` // 日志编码
Title string `json:"title" gorm:"size:255;"` // 操作模块
BusinessType string `json:"businessType" gorm:"size:128;"` // 操作类型
BusinessTypes string `json:"businessTypes" gorm:"size:128;"` // 操作类型
Method string `json:"method" gorm:"size:128;"` // 函数
RequestMethod string `json:"requestMethod" gorm:"size:128;"` // 请求方式
OperatorType string `json:"operatorType" gorm:"size:128;"` // 操作类型
OperName string `json:"operName" gorm:"size:128;"` // 操作者
DeptName string `json:"deptName" gorm:"size:128;"` // 部门名称
OperURL string `json:"operUrl" gorm:"size:255;"` // 访问地址
OperIP string `json:"operIp" gorm:"size:128;"` // 客户端ip
OperLocation string `json:"operLocation" gorm:"size:128;"` // 访问位置
OperParam string `json:"operParam" gorm:"size:255;"` // 请求参数
Status string `json:"status" gorm:"size:4;"` // 操作状态
OperTime time.Time `json:"operTime" gorm:"type:timestamp;"` // 操作时间
JSONResult string `json:"jsonResult" gorm:"size:255;"` // 返回数据
CreateBy string `json:"createBy" gorm:"size:128;"` // 创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` // 更新者
DataScope string `json:"dataScope" gorm:"-"` // 数据
Params string `json:"params" gorm:"-"` // 参数
Remark string `json:"remark" gorm:"size:255;"` // 备注
LatencyTime string `json:"latencyime" gorm:"size:128;"` // 耗时
UserAgent string `json:"userAgent" gorm:"size:255;"` // UserAgent
models.AtModel
}
OperLog 操作日志
func (*OperLog) BatchDelete ¶
BatchDelete 批量删除
func (*OperLog) Query ¶
func (m *OperLog) Query(db *gorm.DB, params param.OperLogParam) (*pagination.Result, error)
Query 查询数据
type Post ¶
type Post struct {
ID int `gorm:"primaryKey;autoIncrement;" json:"id"` //岗位编号
Name string `gorm:"size:128;" json:"name"` //岗位名称
Code string `gorm:"size:128;" json:"code"` //岗位代码
Seq int `gorm:"type:int(11);" json:"seq"` //岗位排序
Status int `gorm:"type:int(11);" json:"status"` //状态
Remark string `gorm:"size:255;" json:"remark"` //描述
CreateBy int `gorm:"type:int(11);" json:"createBy"`
UpdateBy int `gorm:"type:int(11);" json:"updateBy"`
models.AtModel
DataScope string `gorm:"-" json:"dataScope"`
Params string `gorm:"-" json:"params"`
}
Post 岗位实体
func (*Post) BatchDelete ¶
BatchDelete 批量删除
type Role ¶
type Role struct {
RoleID int `json:"id" gorm:"primaryKey;autoIncrement;"` // 角色编码
RoleName string `json:"name" gorm:"size:128;"` // 角色名称
Status string `json:"status" gorm:"size:4;"` // 角色状态
RoleKey string `json:"roleKey" gorm:"size:128;"` // 角色代码
RoleSort int `json:"sort" gorm:""` // 角色排序
Flag string `json:"flag" gorm:"size:128;"` // 标识
Remark string `json:"remark" gorm:"size:255;"` // 备注
CreateBy string `json:"createBy" gorm:"size:128;"` // 创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` // 更新人
Admin bool `json:"admin" gorm:"size:4;"` // 管理员
ChildMembers int `json:"childMembers" gorm:"type:int(11);comment:角色关联的最大用户量;"` //角色关联的最大用户量
DataScope string `json:"dataScope" gorm:"size:128;"` // 数据权限
models.AtModel
Params string `json:"params" gorm:"-"`
MenuIDs []int `json:"menuIds" gorm:"-"`
DeptIDs []int `json:"deptIds" gorm:"-"`
}
Role 角色实体
func (*Role) BatchDelete ¶
BatchDelete 批量删除
func (*Role) GetWithDept ¶
GetWithDept 获取角色对应部门ID
func (*Role) GetWithMenu ¶
GetWithMenu 获取角色对应菜单ID
type RoleMenu ¶
type RoleMenu struct {
RoleID int `gorm:""`
MenuID int `gorm:""`
RoleName string `gorm:"size:128;"`
CreateBy string `gorm:"size:128;"`
UpdateBy string `gorm:"size:128;"`
}
RoleMenu 角色菜单实体
func (*RoleMenu) BatchDeleteRoleMenu ¶
BatchDeleteRoleMenu 批量删除角色菜单(该方法即将弃用)
func (*RoleMenu) DeleteRoleMenu ¶
DeleteRoleMenu 删除角色菜单
type Setting ¶
type Setting struct {
SettingsID int `json:"settings_id" gorm:"primaryKey;autoIncrement"`
Name string `json:"name" gorm:"type:varchar(256);"`
Logo string `json:"logo" gorm:"type:varchar(256);"`
models.AtModel
}
Setting 设置
type TableIndex ¶
type TableIndex struct {
Table string `gorm:"column:Table"` // 表名
NonUnique int `gorm:"column:Non_unique"` // 唯一索引
KeyName string `gorm:"column:Key_name"` // 索引名称
SeqInIndex int `gorm:"column:Seq_in_index"` // 索引中的列序列号
ColumnName string `gorm:"column:Column_name"` // 索引的列名
Visible string `gorm:"column:Visible"` // 不可见索引
Clustered bool `gorm:"-"` // 聚合索引
}
TableIndex 表索引
type Tables ¶
type Tables struct {
ID int `gorm:"primaryKey;autoIncrement;" json:"id"` // ID
Name string `gorm:"size:64;index:idx_name;" json:"name"` // 表名
Comment string `gorm:"size:128;index:idx_comment;" json:"comment"` // 备注(注释)
Project string `gorm:"size:128;" json:"project"` // 项目名称(默认名称:程序运行的路径获取)
Module string `gorm:"size:128;" json:"module"` // 模块名(默认模块名称: 表名)
Frontend string `gorm:"size:128;" json:"frontend"` // 前端文件路径(默认目录:./www;需要指定前端文件的基础目录)
Backend string `gorm:"size:128;" json:"backend"` // 后端文件存储路径(默认目录: modules)
Crud string `gorm:"size:128;" json:"crud"` // 增删改查(可以指定其中一种或几种; 默认:C,D,U,Q C:Create U:Update D:Delete,BatchDelete Q:Get,Query)
Entity string `gorm:"size:128;" json:"entity"` // 实体类名称(默认值: 表名去掉前缀转驼峰)
PkColumn string `gorm:"size:128;" json:"pkColumn"` // 主键字段
FileName string `gorm:"size:128;" json:"fileName"` // 文件名(默认值:表名去掉前缀)
DataScope int `gorm:"size:1;default:0;" json:"dataScope"` // 需要校验数据权限(默认值: 否;是:1 否:2)
Auth int `gorm:"size:1;default:1;" json:"auth"` // 需要认证(默认值: 是;是:1 否:2)
LogicalDelete int `gorm:"size:1;default:1;" json:"logicalDelete"` // 逻辑删除(默认值: 是;是:1 否:2)
LogicalDeleteColumn string `gorm:"size:128;default:'delete_at';" json:"logicalDeleteColumn"` // 逻辑删除对应字段(默认值: delete_at)
ParentMenu int `gorm:"type:int(11);default:0;" json:"parentMenu"` // 父级菜单ID(默认: 0)
APIParentMenu int `gorm:"type:int(11);default:63;" json:"apiParentMenu"` // 接口父级菜单ID(默认: 63)
Remark string `gorm:"size:255;default:'';" json:"remark"` // 备注
CreatedAt time.Time `gorm:"type:timestamp;default:CURRENT_TIMESTAMP;" json:"createdAt"` // 创建时间
Columns []Columns `gorm:"-" json:"columns"` // 表字段列
}
Tables 表
func (*Tables) BatchDelete ¶
BatchDelete 批量删除
func (*Tables) Query ¶
func (m *Tables) Query(db *gorm.DB, params param.TablesParam) (*pagination.Result, error)
Query 查询数据
type User ¶
type User struct {
UserID int `gorm:"primaryKey;autoIncrement;" json:"id"` // 用户ID
Username string `gorm:"size:64" json:"userName"` // 用户名
Password string `gorm:"size:128" json:"password"` // 密码
NickName string `gorm:"size:128" json:"nickName"` // 昵称
Phone string `gorm:"size:11" json:"phone"` // 手机号
RoleID int `gorm:"index:idx_role_id;" json:"roleId"` // 角色编码
Salt string `gorm:"size:255" json:"salt"` // 盐
Avatar string `gorm:"size:255" json:"avatar"` // 头像
Sex int `gorm:"type:int(11)" json:"sex"` // 性别
Email string `gorm:"size:128" json:"email"` // 邮箱
DeptID int `gorm:"" json:"deptId"` // 部门编码
PostID int `gorm:"" json:"postId"` // 职位编码
CreateBy string `gorm:"size:128" json:"createBy"` // 创建人
UpdateBy string `gorm:"size:128" json:"updateBy"` // 更新人
Remark string `gorm:"size:255" json:"remark"` // 备注
Status int `gorm:"type:int(11)" json:"status"` // 状态
models.AtModel
DataScope string `gorm:"-" json:"dataScope"`
Params string `gorm:"-" json:"params"`
}
User 用户实体
func (*User) MemberCountInDept ¶ added in v1.1.3
func (*User) MemberCountLinkRole ¶ added in v1.1.3
关联到具体role_id下的用户