-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
106 changed files
with
8,920 additions
and
3,185 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,193 +1,246 @@ | ||
/** | ||
* Copyright (C) 2009-2024 56X.NET, All rights reserved. | ||
* | ||
* name : model_gen.go | ||
* author : jarrysix | ||
* date : 2024/07/15 13:44:47 | ||
* description : | ||
* history : | ||
*/ | ||
package model | ||
|
||
// 部门 | ||
type PermDept struct { | ||
// RbacDict 数据字典 | ||
type RbacDict struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
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"` | ||
} | ||
|
||
func (r RbacDict) TableName() string { | ||
return "rbac_dict" | ||
} | ||
|
||
// RbacDepart 部门 | ||
type RbacDepart struct { | ||
// ID | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 名称 | ||
Name string `db:"name"` | ||
// 编码 | ||
Code string `db:"code"` | ||
Name string `json:"name" db:"name" gorm:"column:name" bson:"name"` | ||
// 上级部门 | ||
Pid int64 `db:"pid"` | ||
Pid int `json:"pid" db:"pid" gorm:"column:pid" bson:"pid"` | ||
// 状态 | ||
Enabled int16 `db:"enabled"` | ||
Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"` | ||
// 部门代码 | ||
Code string `json:"code" db:"code" gorm:"column:code" bson:"code"` | ||
} | ||
|
||
// 数据字典详情 | ||
type PermDictDetail struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
// 字典标签 | ||
Label string `db:"label"` | ||
// 字典值 | ||
Value string `db:"value"` | ||
// 排序 | ||
Sort string `db:"sort"` | ||
// 字典id | ||
DictId int64 `db:"dict_id"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
func (r RbacDepart) TableName() string { | ||
return "rbac_depart" | ||
} | ||
|
||
// 数据字典 | ||
type PermDict struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
// 字典名称 | ||
Name string `db:"name"` | ||
// 描述 | ||
Remark string `db:"remark"` | ||
// 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 int64 `db:"create_time"` | ||
CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"` | ||
// 角色代码 | ||
Code string `json:"code" db:"code" gorm:"column:code" bson:"code"` | ||
} | ||
|
||
// 岗位 | ||
type PermJob struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
func (r RbacRole) TableName() string { | ||
return "rbac_role" | ||
} | ||
|
||
// RbacJob 岗位 | ||
type RbacJob struct { | ||
// ID | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 岗位名称 | ||
Name string `db:"name"` | ||
Name string `json:"name" db:"name" gorm:"column:name" bson:"name"` | ||
// 岗位状态 | ||
Enabled int16 `db:"enabled"` | ||
Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"` | ||
// 岗位排序 | ||
Sort int `db:"sort"` | ||
Sort int `json:"sort" db:"sort" gorm:"column:sort" bson:"sort"` | ||
// 部门ID | ||
DeptId int64 `db:"dept_id"` | ||
DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"` | ||
} | ||
|
||
func (r RbacJob) TableName() string { | ||
return "rbac_job" | ||
} | ||
|
||
// 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"` | ||
} | ||
|
||
func (r RbacLoginLog) TableName() string { | ||
return "rbac_login_log" | ||
} | ||
|
||
// PermRes | ||
type PermRes struct { | ||
// RbacRes RbacRes | ||
type RbacRes struct { | ||
// 资源ID | ||
Id int `db:"id" pk:"yes" auto:"yes"` | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 资源名称 | ||
Name string `db:"name"` | ||
// 资源类型, 1:页面 2:组件 3:资源 | ||
ResType int `db:"res_type"` | ||
// 资源键 | ||
ResKey string `db:"res_key"` | ||
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 `db:"pid"` | ||
// 深度/层级 | ||
Depth int `db:"depth"` | ||
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 `db:"path"` | ||
Path string `json:"path" db:"path" gorm:"column:path" bson:"path"` | ||
// 图标 | ||
Icon string `db:"icon"` | ||
Icon string `json:"icon" db:"icon" gorm:"column:icon" bson:"icon"` | ||
// 排序 | ||
SortNum int `db:"sort_num"` | ||
// 是否显示到菜单 | ||
IsMenu int `db:"is_menu"` | ||
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 `db:"is_enabled"` | ||
// 是否禁用 | ||
IsForbidden int `db:"is_forbidden"` | ||
IsEnabled int `json:"isEnabled" db:"is_enabled" gorm:"column:is_enabled" bson:"isEnabled"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
// 组件名称 | ||
ComponentName string `db:"component_name"` | ||
// 应用序号,0代表当前应用 | ||
AppIndex int `db:"app_index"` | ||
CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"` | ||
// 组件路径 | ||
ComponentName string `json:"componentName" db:"component_name" gorm:"column:component_name" bson:"componentName"` | ||
// 深度/层级 | ||
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"` | ||
} | ||
|
||
// 角色部门关联 | ||
type PermRoleDept struct { | ||
func (r RbacRes) TableName() string { | ||
return "rbac_res" | ||
} | ||
|
||
// RbacRoleDept 角色部门关联 | ||
type RbacRoleDept struct { | ||
// 编号 | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 角色编号 | ||
RoleId int64 `db:"role_id"` | ||
RoleId int `json:"roleId" db:"role_id" gorm:"column:role_id" bson:"roleId"` | ||
// 部门编号 | ||
DeptId int64 `db:"dept_id"` | ||
DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"` | ||
} | ||
|
||
// 角色 | ||
type PermRole struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
// 角色代码 | ||
Code string `db:"code"` | ||
// 名称 | ||
Name string `db:"name"` | ||
// 角色级别 | ||
Level int `db:"level"` | ||
// 数据权限 | ||
DataScope string `db:"data_scope"` | ||
// 备注 | ||
Remark string `db:"remark"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
func (r RbacRoleDept) TableName() string { | ||
return "rbac_role_dept" | ||
} | ||
|
||
// 角色菜单关联 | ||
type PermRoleRes struct { | ||
// RbacRoleRes 角色菜单关联 | ||
type RbacRoleRes struct { | ||
// 编号 | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 菜单ID | ||
ResId int `db:"res_id"` | ||
ResId int `json:"resId" db:"res_id" gorm:"column:res_id" bson:"resId"` | ||
// 角色ID | ||
RoleId int `db:"role_id"` | ||
// 权限位值, 1:增加 2:删除 4: 更新 | ||
PermFlag int `db:"perm_flag"` | ||
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"` | ||
} | ||
|
||
// 系统用户 | ||
type PermUser struct { | ||
// Id | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
func (r RbacRoleRes) TableName() string { | ||
return "rbac_role_res" | ||
} | ||
|
||
// RbacUser 系统用户 | ||
type RbacUser struct { | ||
// ID | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 用户名 | ||
Username string `db:"username"` | ||
Username string `json:"username" db:"username" gorm:"column:username" bson:"username"` | ||
// 密码 | ||
Password string `db:"password"` | ||
Password string `json:"password" db:"password" gorm:"column:password" bson:"password"` | ||
// 加密盐 | ||
Salt string `db:"salt"` | ||
Salt string `json:"salt" db:"salt" gorm:"column:salt" bson:"salt"` | ||
// 标志 | ||
Flag int `db:"flag"` | ||
Flag int `json:"flag" db:"flag" gorm:"column:flag" bson:"flag"` | ||
// 头像 | ||
Avatar string `db:"avatar"` | ||
// Nickname | ||
Nickname string `db:"nickname"` | ||
// Gender | ||
Gender int `db:"gender"` | ||
Avatar string `json:"avatar" db:"avatar" gorm:"column:avatar" bson:"avatar"` | ||
// 姓名 | ||
Nickname string `json:"nickname" db:"nickname" gorm:"column:nickname" bson:"nickname"` | ||
// 性别 | ||
Gender int `json:"gender" db:"gender" gorm:"column:gender" bson:"gender"` | ||
// 邮箱 | ||
Email string `db:"email"` | ||
Email string `json:"email" db:"email" gorm:"column:email" bson:"email"` | ||
// 手机号码 | ||
Phone string `db:"phone"` | ||
Phone string `json:"phone" db:"phone" gorm:"column:phone" bson:"phone"` | ||
// 部门编号 | ||
DeptId int64 `db:"dept_id"` | ||
DeptId int `json:"deptId" db:"dept_id" gorm:"column:dept_id" bson:"deptId"` | ||
// 岗位编号 | ||
JobId int64 `db:"job_id"` | ||
JobId int `json:"jobId" db:"job_id" gorm:"column:job_id" bson:"jobId"` | ||
// 状态:1启用、0禁用 | ||
Enabled int16 `db:"enabled"` | ||
Enabled int `json:"enabled" db:"enabled" gorm:"column:enabled" bson:"enabled"` | ||
// 最后登录的日期 | ||
LastLogin int64 `db:"last_login"` | ||
LastLogin int `json:"lastLogin" db:"last_login" gorm:"column:last_login" bson:"lastLogin"` | ||
// 创建日期 | ||
CreateTime int64 `db:"create_time"` | ||
CreateTime int `json:"createTime" db:"create_time" gorm:"column:create_time" bson:"createTime"` | ||
} | ||
|
||
// 用户角色关联 | ||
type PermUserRole struct { | ||
func (r RbacUser) TableName() string { | ||
return "rbac_user" | ||
} | ||
|
||
// RbacUserRole 用户角色关联 | ||
type RbacUserRole struct { | ||
// 编号 | ||
Id int64 `db:"id" pk:"yes" auto:"yes"` | ||
Id int `json:"id" db:"id" gorm:"column:id" pk:"yes" auto:"yes" bson:"id"` | ||
// 用户ID | ||
UserId int64 `db:"user_id"` | ||
UserId int `json:"userId" db:"user_id" gorm:"column:user_id" bson:"userId"` | ||
// 角色ID | ||
RoleId int64 `db:"role_id"` | ||
RoleId int `json:"roleId" db:"role_id" gorm:"column:role_id" bson:"roleId"` | ||
} | ||
|
||
// LoginLog 用户登录日志 | ||
type LoginLog struct { | ||
// 编号 | ||
Id int64 `db:"id" pk:"yes" auto:"yes" json:"id"` | ||
// 用户编号 | ||
UserId int64 `db:"user_id" json:"userId"` | ||
// 登录IP地址 | ||
Ip string `db:"ip" json:"ip"` | ||
// 是否成功 | ||
IsSuccess int `db:"is_success" json:"isSuccess"` | ||
// 创建时间 | ||
CreateTime int64 `db:"create_time" json:"createTime"` | ||
func (r RbacUserRole) TableName() string { | ||
return "rbac_user_role" | ||
} | ||
|
||
// 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"` | ||
} | ||
|
||
func (r RbacDictDetail) TableName() string { | ||
return "rbac_dict_detail" | ||
} |
Oops, something went wrong.