feat: 更新多个模块以支持新的数据结构和日志格式
This commit is contained in:
@@ -1,25 +1,21 @@
|
||||
package model
|
||||
|
||||
// 参数配置对象 sys_config
|
||||
// SysConfig 参数配置表
|
||||
type SysConfig struct {
|
||||
// 参数主键
|
||||
ConfigID string `json:"configId"`
|
||||
// 参数名称
|
||||
ConfigName string `json:"configName" binding:"required"`
|
||||
// 参数键名
|
||||
ConfigKey string `json:"configKey" binding:"required"`
|
||||
// 参数键值
|
||||
ConfigValue string `json:"configValue" binding:"required"`
|
||||
// 系统内置(Y是 N否)
|
||||
ConfigType string `json:"configType"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
ConfigId int64 `json:"configId" gorm:"column:config_id;primaryKey;autoIncrement"` // 参数ID
|
||||
ConfigName string `json:"configName" gorm:"column:config_name" binding:"required"` // 参数名称
|
||||
ConfigKey string `json:"configKey" gorm:"column:config_key" binding:"required"` // 参数键名
|
||||
ConfigValue string `json:"configValue" gorm:"column:config_value" binding:"required"` // 参数键值
|
||||
ConfigType string `json:"configType" gorm:"column:config_type"` // 系统内置(Y是 N否)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysConfig) TableName() string {
|
||||
return "sys_config"
|
||||
}
|
||||
|
||||
@@ -1,41 +1,28 @@
|
||||
package model
|
||||
|
||||
// SysDept 部门对象 sys_dept
|
||||
// SysDept 部门表
|
||||
type SysDept struct {
|
||||
// 部门ID
|
||||
DeptID string `json:"deptId"`
|
||||
// 父部门ID
|
||||
ParentID string `json:"parentId" binding:"required"`
|
||||
// 祖级列表
|
||||
Ancestors string `json:"ancestors"`
|
||||
// 部门名称
|
||||
DeptName string `json:"deptName" binding:"required"`
|
||||
// 显示顺序
|
||||
OrderNum int `json:"orderNum"`
|
||||
// 负责人
|
||||
Leader string `json:"leader"`
|
||||
// 联系电话
|
||||
Phone string `json:"phone"`
|
||||
// 邮箱
|
||||
Email string `json:"email"`
|
||||
// 部门状态(0正常 1停用)
|
||||
Status string `json:"status"`
|
||||
// 删除标志(0代表存在 1代表删除)
|
||||
DelFlag string `json:"delFlag"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
DeptId int64 `json:"deptId" gorm:"column:dept_id;primaryKey;autoIncrement"` // 部门ID
|
||||
ParentId int64 `json:"parentId" gorm:"column:parent_id" binding:"required"` // 父部门ID 默认0
|
||||
Ancestors string `json:"ancestors" gorm:"column:ancestors"` // 祖级列表
|
||||
DeptName string `json:"deptName" gorm:"column:dept_name" binding:"required"` // 部门名称
|
||||
DeptSort int64 `json:"deptSort" gorm:"column:dept_sort"` // 显示顺序
|
||||
Leader string `json:"leader" gorm:"column:leader"` // 负责人
|
||||
Phone string `json:"phone" gorm:"column:phone"` // 联系电话
|
||||
Email string `json:"email" gorm:"column:email"` // 邮箱
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 部门状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
// 子部门列表
|
||||
Children []SysDept `json:"children,omitempty"`
|
||||
|
||||
// 父部门名称
|
||||
ParentName string `json:"parentName,omitempty"`
|
||||
Children []SysDept `json:"children,omitempty" gorm:"-"` // 子部门列表
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysDept) TableName() string {
|
||||
return "sys_dept"
|
||||
}
|
||||
|
||||
@@ -1,31 +1,24 @@
|
||||
package model
|
||||
|
||||
// SysDictData 字典数据对象 sys_dict_data
|
||||
// SysDictData 字典数据表
|
||||
type SysDictData struct {
|
||||
// 字典编码
|
||||
DictCode string `json:"dictCode"`
|
||||
// 字典排序
|
||||
DictSort int `json:"dictSort"`
|
||||
// 字典标签
|
||||
DictLabel string `json:"dictLabel" binding:"required"`
|
||||
// 字典键值
|
||||
DictValue string `json:"dictValue" binding:"required"`
|
||||
// 字典类型
|
||||
DictType string `json:"dictType" binding:"required"`
|
||||
// 样式属性(样式扩展)
|
||||
TagClass string `json:"tagClass"`
|
||||
// 标签类型(预设颜色)
|
||||
TagType string `json:"tagType"`
|
||||
// 状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
DataId int64 `json:"dataId" gorm:"column:data_id;primaryKey;autoIncrement"` // 数据ID
|
||||
DictType string `json:"dictType" gorm:"column:dict_type" binding:"required"` // 字典类型
|
||||
DataLabel string `json:"dataLabel" gorm:"column:data_label" binding:"required"` // 数据标签
|
||||
DataValue string `json:"dataValue" gorm:"column:data_value" binding:"required"` // 数据键值
|
||||
DataSort int64 `json:"dataSort" gorm:"column:data_sort"` // 数据排序
|
||||
TagClass string `json:"tagClass" gorm:"column:tag_class"` // 样式属性(样式扩展)
|
||||
TagType string `json:"tagType" gorm:"column:tag_type"` // 标签类型(预设颜色)
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysDictData) TableName() string {
|
||||
return "sys_dict_data"
|
||||
}
|
||||
|
||||
@@ -1,23 +1,20 @@
|
||||
package model
|
||||
|
||||
// SysDictType 字典类型对象 sys_dict_type
|
||||
// SysDictType 字典类型表
|
||||
type SysDictType struct {
|
||||
// 字典主键
|
||||
DictID string `json:"dictId"`
|
||||
// 字典名称
|
||||
DictName string `json:"dictName" binding:"required"`
|
||||
// 字典类型
|
||||
DictType string `json:"dictType" binding:"required"`
|
||||
// 状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
DictId int64 `json:"dictId" gorm:"column:dict_id;primaryKey;autoIncrement"` // 字典ID
|
||||
DictName string `json:"dictName" gorm:"column:dict_name" binding:"required"` // 字典名称
|
||||
DictType string `json:"dictType" gorm:"column:dict_type" binding:"required"` // 字典类型
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysDictType) TableName() string {
|
||||
return "sys_dict_type"
|
||||
}
|
||||
|
||||
19
src/modules/system/model/sys_i18n.go
Normal file
19
src/modules/system/model/sys_i18n.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package model
|
||||
|
||||
// SysI18n 系统_多语言 sys_i18n
|
||||
type SysI18n struct {
|
||||
ID int64 `json:"id" gorm:"column:config_id;primaryKey;autoIncrement"` // ID
|
||||
DelFlag string `json:"delFlag" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Key string `json:"key" gorm:"column:key"` // 多语言属性名
|
||||
ValueZh string `json:"valueZh" gorm:"column:value_zh"` // 中文
|
||||
ValueEn string `json:"valueEn" gorm:"column:value_en"` // 英文
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysI18n) TableName() string {
|
||||
return "sys_i18n"
|
||||
}
|
||||
@@ -1,23 +1,19 @@
|
||||
package model
|
||||
|
||||
// SysLogLogin 系统登录日志表 sys_log_login
|
||||
// SysLogLogin 系统登录日志表
|
||||
type SysLogLogin struct {
|
||||
// 登录ID
|
||||
LoginID string `json:"loginId"`
|
||||
// 用户账号
|
||||
UserName string `json:"userName"`
|
||||
// 登录IP地址
|
||||
IPAddr string `json:"ipaddr"`
|
||||
// 登录地点
|
||||
LoginLocation string `json:"loginLocation"`
|
||||
// 浏览器类型
|
||||
Browser string `json:"browser"`
|
||||
// 操作系统
|
||||
OS string `json:"os"`
|
||||
// 登录状态(0失败 1成功)
|
||||
Status string `json:"status"`
|
||||
// 提示消息
|
||||
Msg string `json:"msg"`
|
||||
// 访问时间
|
||||
LoginTime int64 `json:"loginTime"`
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"` // 登录ID
|
||||
UserName string `json:"userName" gorm:"column:user_name"` // 用户账号
|
||||
LoginIp string `json:"loginIp" gorm:"column:login_ip"` // 登录IP地址
|
||||
LoginLocation string `json:"loginLocation" gorm:"column:login_location"` // 登录地点
|
||||
Browser string `json:"browser" gorm:"column:browser"` // 浏览器类型
|
||||
OS string `json:"os" gorm:"column:os"` // 操作系统
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 登录状态(0失败 1成功)
|
||||
Msg string `json:"msg" gorm:"column:msg"` // 提示消息
|
||||
LoginTime int64 `json:"loginTime" gorm:"column:login_time"` // 登录时间
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysLogLogin) TableName() string {
|
||||
return "sys_log_login"
|
||||
}
|
||||
|
||||
@@ -1,37 +1,24 @@
|
||||
package model
|
||||
|
||||
// SysLogOperate 系统操作日志表 sys_log_operate
|
||||
// SysLogOperate 系统操作日志表
|
||||
type SysLogOperate struct {
|
||||
// 日志主键
|
||||
OperID string `json:"operId"`
|
||||
// 模块标题
|
||||
Title string `json:"title"`
|
||||
// 业务类型(0其它 1新增 2修改 3删除 4授权 5导出 6导入 7强退 8清空数据)
|
||||
BusinessType string `json:"businessType"`
|
||||
// 方法名称
|
||||
Method string `json:"method"`
|
||||
// 请求方式
|
||||
RequestMethod string `json:"requestMethod"`
|
||||
// 操作人员类别(0其它 1后台用户 2手机端用户)
|
||||
OperatorType string `json:"operatorType"`
|
||||
// 操作人员
|
||||
OperName string `json:"operName"`
|
||||
// 部门名称
|
||||
DeptName string `json:"deptName"`
|
||||
// 请求URL
|
||||
OperURL string `json:"operUrl"`
|
||||
// 主机地址
|
||||
OperIP string `json:"operIp"`
|
||||
// 操作地点
|
||||
OperLocation string `json:"operLocation"`
|
||||
// 请求参数
|
||||
OperParam string `json:"operParam"`
|
||||
// 操作消息
|
||||
OperMsg string `json:"operMsg"`
|
||||
// 操作状态(0异常 1正常)
|
||||
Status string `json:"status"`
|
||||
// 操作时间
|
||||
OperTime int64 `json:"operTime"`
|
||||
// 消耗时间(毫秒)
|
||||
CostTime int64 `json:"costTime"`
|
||||
ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement"` // 操作ID
|
||||
Title string `json:"title" gorm:"column:title"` // 模块标题
|
||||
BusinessType string `json:"businessType" gorm:"column:business_type"` // 业务类型(0其它 1新增 2修改 3删除 4授权 5导出 6导入 7强退 8清空数据)
|
||||
OperaUrl string `json:"operaUrl" gorm:"column:opera_url"` // 请求URL
|
||||
OperaUrlMethod string `json:"operaUrlMethod" gorm:"column:opera_url_method"` // 请求方式
|
||||
OperaIp string `json:"operaIp" gorm:"column:opera_ip"` // 主机地址
|
||||
OperaLocation string `json:"operaLocation" gorm:"column:opera_location"` // 操作地点
|
||||
OperaParam string `json:"operaParam" gorm:"column:opera_param"` // 请求参数
|
||||
OperaMsg string `json:"operaMsg" gorm:"column:opera_msg"` // 操作消息
|
||||
OperaMethod string `json:"operaMethod" gorm:"column:opera_method"` // 方法名称
|
||||
OperaBy string `json:"operaBy" gorm:"column:opera_by"` // 操作人员
|
||||
OperaTime int64 `json:"operaTime" gorm:"column:opera_time"` // 操作时间
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 操作状态(0异常 1正常)
|
||||
CostTime int64 `json:"costTime" gorm:"column:cost_time"` // 消耗时间(毫秒)
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysLogOperate) TableName() string {
|
||||
return "sys_log_operate"
|
||||
}
|
||||
|
||||
@@ -1,46 +1,33 @@
|
||||
package model
|
||||
|
||||
// SysMenu 菜单权限对象 sys_menu
|
||||
// SysMenu 菜单权限表
|
||||
type SysMenu struct {
|
||||
// 菜单ID
|
||||
MenuID string `json:"menuId"`
|
||||
// 菜单名称
|
||||
MenuName string `json:"menuName" binding:"required"`
|
||||
// 父菜单ID 默认0
|
||||
ParentID string `json:"parentId" binding:"required"`
|
||||
// 显示顺序
|
||||
MenuSort int `json:"menuSort"`
|
||||
// 路由地址
|
||||
Path string `json:"path"`
|
||||
// 组件路径
|
||||
Component string `json:"component"`
|
||||
// 是否内部跳转(0否 1是)
|
||||
IsFrame string `json:"isFrame"`
|
||||
// 是否缓存(0不缓存 1缓存)
|
||||
IsCache string `json:"isCache"`
|
||||
// 菜单类型(D目录 M菜单 B按钮)
|
||||
MenuType string `json:"menuType" binding:"required"`
|
||||
// 是否显示(0隐藏 1显示)
|
||||
Visible string `json:"visible"`
|
||||
// 菜单状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 权限标识
|
||||
Perms string `json:"perms"`
|
||||
// 菜单图标(#无图标)
|
||||
Icon string `json:"icon"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
MenuId int64 `json:"menuId" gorm:"column:menu_id;primaryKey;autoIncrement"` // 菜单ID
|
||||
MenuName string `json:"menuName" gorm:"column:menu_name" binding:"required"` // 菜单名称
|
||||
ParentId int64 `json:"parentId" gorm:"column:parent_id"` // 父菜单ID 默认0
|
||||
MenuSort int64 `json:"menuSort" gorm:"column:menu_sort"` // 显示顺序
|
||||
MenuPath string `json:"menuPath" gorm:"column:menu_path"` // 路由地址
|
||||
Component string `json:"component" gorm:"column:component"` // 组件路径
|
||||
FrameFlag string `json:"frameFlag" gorm:"column:frame_flag"` // 内部跳转标记(0否 1是)
|
||||
CacheFlag string `json:"cacheFlag" gorm:"column:cache_flag"` // 缓存标记(0不缓存 1缓存)
|
||||
MenuType string `json:"menuType" gorm:"column:menu_type" binding:"required"` // 菜单类型(D目录 M菜单 A访问权限)
|
||||
VisibleFlag string `json:"visibleFlag" gorm:"column:visible_flag"` // 是否显示(0隐藏 1显示)
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 菜单状态(0停用 1正常)
|
||||
Perms string `json:"perms" gorm:"column:perms"` // 权限标识
|
||||
Icon string `json:"icon" gorm:"column:icon"` // 菜单图标(#无图标)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
// 子菜单
|
||||
Children []SysMenu `json:"children,omitempty"`
|
||||
Children []SysMenu `json:"children,omitempty" gorm:"-"` // 子菜单
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysMenu) TableName() string {
|
||||
return "sys_menu"
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package model
|
||||
|
||||
// SysNotice 通知公告对象 sys_notice
|
||||
type SysNotice struct {
|
||||
// 公告ID
|
||||
NoticeID string `json:"noticeId"`
|
||||
// 公告标题
|
||||
NoticeTitle string `json:"noticeTitle" binding:"required"`
|
||||
// 公告类型(1通知 2公告)
|
||||
NoticeType string `json:"noticeType" binding:"required"`
|
||||
// 公告内容
|
||||
NoticeContent string `json:"noticeContent" binding:"required"`
|
||||
// 公告状态(0关闭 1正常)
|
||||
Status string `json:"status"`
|
||||
// 删除标志(0代表存在 1代表删除)
|
||||
DelFlag string `json:"delFlag"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
@@ -1,25 +1,21 @@
|
||||
package model
|
||||
|
||||
// SysPost 岗位对象 sys_post
|
||||
// SysPost 岗位信息表
|
||||
type SysPost struct {
|
||||
// 岗位ID
|
||||
PostID string `json:"postId"`
|
||||
// 岗位编码
|
||||
PostCode string `json:"postCode" binding:"required"`
|
||||
// 岗位名称
|
||||
PostName string `json:"postName" binding:"required"`
|
||||
// 显示顺序
|
||||
PostSort int `json:"postSort"`
|
||||
// 状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
PostId int64 `json:"postId" gorm:"column:post_id;primaryKey;autoIncrement"` // 岗位ID
|
||||
PostCode string `json:"postCode" gorm:"column:post_code" binding:"required"` // 岗位编码
|
||||
PostName string `json:"postName" gorm:"column:post_name" binding:"required"` // 岗位名称
|
||||
PostSort int64 `json:"postSort" gorm:"column:post_sort"` // 显示顺序
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysPost) TableName() string {
|
||||
return "sys_post"
|
||||
}
|
||||
|
||||
@@ -1,40 +1,29 @@
|
||||
package model
|
||||
|
||||
// SysRole 角色对象 sys_role
|
||||
// SysRole 角色信息表
|
||||
type SysRole struct {
|
||||
// 角色ID
|
||||
RoleID string `json:"roleId"`
|
||||
// 角色名称
|
||||
RoleName string `json:"roleName" binding:"required"`
|
||||
// 角色键值
|
||||
RoleKey string `json:"roleKey" binding:"required"`
|
||||
// 显示顺序
|
||||
RoleSort int `json:"roleSort"`
|
||||
// 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限)
|
||||
DataScope string `json:"dataScope"`
|
||||
// 菜单树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示)
|
||||
MenuCheckStrictly string `json:"menuCheckStrictly"`
|
||||
// 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示)
|
||||
DeptCheckStrictly string `json:"deptCheckStrictly"`
|
||||
// 角色状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 删除标志(0代表存在 1代表删除)
|
||||
DelFlag string `json:"delFlag"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
RoleId int64 `json:"roleId" gorm:"column:role_id;primaryKey;autoIncrement"` // 角色ID
|
||||
RoleName string `json:"roleName" gorm:"column:role_name" binding:"required"` // 角色名称
|
||||
RoleKey string `json:"roleKey" gorm:"column:role_key" binding:"required"` // 角色键值
|
||||
RoleSort int64 `json:"roleSort" gorm:"column:role_sort"` // 显示顺序
|
||||
DataScope string `json:"dataScope" gorm:"column:data_scope"` // 数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:仅本人数据权限)
|
||||
MenuCheckStrictly string `json:"menuCheckStrictly" gorm:"column:menu_check_strictly"` // 菜单树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示)
|
||||
DeptCheckStrictly string `json:"deptCheckStrictly" gorm:"column:dept_check_strictly"` // 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 角色状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
// 菜单组
|
||||
MenuIds []string `json:"menuIds,omitempty"`
|
||||
// 部门组(数据权限)
|
||||
DeptIds []string `json:"deptIds,omitempty"`
|
||||
MenuIds []int64 `json:"menuIds,omitempty" gorm:"-"` // 菜单组
|
||||
DeptIds []int64 `json:"deptIds,omitempty" gorm:"-"` // 部门组(数据权限)
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysRole) TableName() string {
|
||||
return "sys_role"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package model
|
||||
|
||||
// SysRoleDept 角色和部门关联对象 sys_role_dept
|
||||
// SysRoleDept 角色和部门关联表
|
||||
type SysRoleDept struct {
|
||||
RoleID string `json:"roleId"` // 角色ID
|
||||
DeptID string `json:"deptId"` // 部门ID
|
||||
RoleId int64 `json:"roleId" gorm:"column:role_id"` // 角色ID
|
||||
DeptId int64 `json:"deptId" gorm:"column:dept_id"` // 部门ID
|
||||
}
|
||||
|
||||
// NewSysRoleDept 创建角色和部门关联对象的构造函数
|
||||
func NewSysRoleDept(roleID string, deptID string) SysRoleDept {
|
||||
return SysRoleDept{
|
||||
RoleID: roleID,
|
||||
DeptID: deptID,
|
||||
}
|
||||
// TableName 表名称
|
||||
func (*SysRoleDept) TableName() string {
|
||||
return "sys_role_dept"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package model
|
||||
|
||||
// SysRoleMenu 角色和菜单关联对象 sys_role_menu
|
||||
// SysRoleMenu 角色和菜单关联表
|
||||
type SysRoleMenu struct {
|
||||
RoleID string `json:"roleId"` // 角色ID
|
||||
MenuID string `json:"menuId"` // 菜单ID
|
||||
RoleId int64 `json:"roleId" gorm:"column:role_id"` // 角色ID
|
||||
MenuId int64 `json:"menuId" gorm:"column:menu_id"` // 菜单ID
|
||||
}
|
||||
|
||||
// NewSysRoleMenu 创建角色和菜单关联对象的构造函数
|
||||
func NewSysRoleMenu(roleID string, menuID string) SysRoleMenu {
|
||||
return SysRoleMenu{
|
||||
RoleID: roleID,
|
||||
MenuID: menuID,
|
||||
}
|
||||
// TableName 表名称
|
||||
func (*SysRoleMenu) TableName() string {
|
||||
return "sys_role_menu"
|
||||
}
|
||||
|
||||
@@ -1,56 +1,35 @@
|
||||
package model
|
||||
|
||||
// SysUser 用户对象 sys_user
|
||||
// SysUser 用户信息表
|
||||
type SysUser struct {
|
||||
// 用户ID
|
||||
UserID string `json:"userId"`
|
||||
// 部门ID
|
||||
DeptID string `json:"deptId"`
|
||||
// 用户账号
|
||||
UserName string `json:"userName" binding:"required"`
|
||||
// 用户昵称
|
||||
NickName string `json:"nickName" binding:"required"`
|
||||
// 用户类型(sys系统用户)
|
||||
UserType string `json:"userType"`
|
||||
// 用户邮箱
|
||||
Email string `json:"email"`
|
||||
// 手机号码
|
||||
PhoneNumber string `json:"phonenumber"`
|
||||
// 用户性别(0未知 1男 2女)
|
||||
Sex string `json:"sex"`
|
||||
// 头像地址
|
||||
Avatar string `json:"avatar"`
|
||||
// 密码
|
||||
Password string `json:"-"`
|
||||
// 帐号状态(0停用 1正常)
|
||||
Status string `json:"status"`
|
||||
// 删除标志(0代表存在 1代表删除)
|
||||
DelFlag string `json:"delFlag"`
|
||||
// 最后登录IP
|
||||
LoginIP string `json:"loginIp"`
|
||||
// 最后登录时间
|
||||
LoginDate int64 `json:"loginDate"`
|
||||
// 创建者
|
||||
CreateBy string `json:"createBy"`
|
||||
// 创建时间
|
||||
CreateTime int64 `json:"createTime"`
|
||||
// 更新者
|
||||
UpdateBy string `json:"updateBy"`
|
||||
// 更新时间
|
||||
UpdateTime int64 `json:"updateTime"`
|
||||
// 备注
|
||||
Remark string `json:"remark"`
|
||||
UserId int64 `json:"userId" gorm:"column:user_id;primaryKey;autoIncrement"` // 用户ID
|
||||
DeptId int64 `json:"deptId" gorm:"column:dept_id"` // 部门ID
|
||||
UserName string `json:"userName" gorm:"column:user_name"` // 用户账号
|
||||
Email string `json:"email" gorm:"column:email"` // 用户邮箱
|
||||
Phone string `json:"phone" gorm:"column:phone"` // 手机号码
|
||||
NickName string `json:"nickName" gorm:"column:nick_name"` // 用户昵称
|
||||
Sex string `json:"sex" gorm:"column:sex"` // 用户性别(0未选择 1男 2女)
|
||||
Avatar string `json:"avatar" gorm:"column:avatar"` // 头像地址
|
||||
Password string `json:"-" gorm:"column:password"` // 密码
|
||||
StatusFlag string `json:"statusFlag" gorm:"column:status_flag"` // 账号状态(0停用 1正常)
|
||||
DelFlag string `json:"-" gorm:"column:del_flag"` // 删除标记(0存在 1删除)
|
||||
LoginIp string `json:"loginIp" gorm:"column:login_ip"` // 最后登录IP
|
||||
LoginTime int64 `json:"loginTime" gorm:"column:login_time"` // 最后登录时间
|
||||
CreateBy string `json:"createBy" gorm:"column:create_by"` // 创建者
|
||||
CreateTime int64 `json:"createTime" gorm:"column:create_time"` // 创建时间
|
||||
UpdateBy string `json:"updateBy" gorm:"column:update_by"` // 更新者
|
||||
UpdateTime int64 `json:"updateTime" gorm:"column:update_time"` // 更新时间
|
||||
Remark string `json:"remark" gorm:"column:remark"` // 备注
|
||||
|
||||
// ====== 非数据库字段属性 ======
|
||||
|
||||
// 部门对象
|
||||
Dept SysDept `json:"dept,omitempty" binding:"structonly"`
|
||||
// 角色对象组
|
||||
Roles []SysRole `json:"roles"`
|
||||
// 角色ID
|
||||
RoleID string `json:"roleId,omitempty"`
|
||||
// 角色组
|
||||
RoleIDs []string `json:"roleIds,omitempty"`
|
||||
// 岗位组
|
||||
PostIDs []string `json:"postIds,omitempty"`
|
||||
Dept *SysDept `json:"dept" gorm:"-"` // 部门对象
|
||||
Roles []*SysRole `json:"roles" gorm:"-"` // 角色对象组
|
||||
RoleIds []int64 `json:"roleIds,omitempty" gorm:"-"` // 角色组
|
||||
PostIds []int64 `json:"postIds,omitempty" gorm:"-"` // 岗位组
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
func (*SysUser) TableName() string {
|
||||
return "sys_user"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package model
|
||||
|
||||
// SysUserPost 用户和岗位关联对象 sys_user_post
|
||||
// SysUserPost 用户与岗位关联表
|
||||
type SysUserPost struct {
|
||||
UserID string `json:"userId"` // 用户ID
|
||||
PostID string `json:"postId"` // 岗位ID
|
||||
UserId int64 `json:"userId" gorm:"column:user_id"` // 用户ID
|
||||
PostId int64 `json:"postId" gorm:"column:post_id"` // 岗位ID
|
||||
}
|
||||
|
||||
// NewSysUserPost 创建用户和岗位关联对象的构造函数
|
||||
func NewSysUserPost(userID string, postID string) SysUserPost {
|
||||
return SysUserPost{
|
||||
UserID: userID,
|
||||
PostID: postID,
|
||||
}
|
||||
// TableName 表名称
|
||||
func (*SysUserPost) TableName() string {
|
||||
return "sys_user_post"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package model
|
||||
|
||||
// SysUserRole 用户和角色关联对象 sys_user_role
|
||||
// SysUserRole 用户和角色关联表
|
||||
type SysUserRole struct {
|
||||
UserID string `json:"userId"` // 用户ID
|
||||
RoleID string `json:"roleId"` // 角色ID
|
||||
UserId int64 `json:"userId" gorm:"column:user_id"` // 用户ID
|
||||
RoleId int64 `json:"roleId" gorm:"column:role_id"` // 角色ID
|
||||
}
|
||||
|
||||
// NewSysUserRole 创建用户和角色关联对象的构造函数
|
||||
func NewSysUserRole(userID string, roleID string) SysUserRole {
|
||||
return SysUserRole{
|
||||
UserID: userID,
|
||||
RoleID: roleID,
|
||||
}
|
||||
// TableName 表名称
|
||||
func (*SysUserRole) TableName() string {
|
||||
return "sys_user_role"
|
||||
}
|
||||
|
||||
21
src/modules/system/model/vo/router.go
Normal file
21
src/modules/system/model/vo/router.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package vo
|
||||
|
||||
// Router 路由信息对象
|
||||
type Router struct {
|
||||
Name string `json:"name"` // 路由名字 英文首字母大写
|
||||
Path string `json:"path"` // 路由地址
|
||||
Meta RouterMeta `json:"meta"` // 其他元素
|
||||
Component string `json:"component"` // 组件地址
|
||||
Redirect string `json:"redirect"` // 重定向地址
|
||||
Children []Router `json:"children,omitempty"` // 子路由
|
||||
}
|
||||
|
||||
// RouterMeta 路由元信息对象
|
||||
type RouterMeta struct {
|
||||
Title string `json:"title"` // 设置该菜单在侧边栏和面包屑中展示的名字
|
||||
Icon string `json:"icon"` // 设置该菜单的图标
|
||||
Cache bool `json:"cache"` // 设置为true,则不会被 <keep-alive>缓存
|
||||
Target string `json:"target"` // 内链地址(http(s)://开头), 打开目标位置 '_blank' | '_self' | ''
|
||||
HideChildInMenu bool `json:"hideChildInMenu"` // 在菜单中隐藏子节点
|
||||
HideInMenu bool `json:"hideInMenu"` // 在菜单中隐藏自己和子节点
|
||||
}
|
||||
46
src/modules/system/model/vo/tree_select.go
Normal file
46
src/modules/system/model/vo/tree_select.go
Normal file
@@ -0,0 +1,46 @@
|
||||
package vo
|
||||
|
||||
import "be.ems/src/modules/system/model"
|
||||
|
||||
// TreeSelect 树结构实体类
|
||||
type TreeSelect struct {
|
||||
ID int64 `json:"id"` // 节点ID
|
||||
Label string `json:"label"` // 节点名称
|
||||
Children []TreeSelect `json:"children"` // 子节点
|
||||
}
|
||||
|
||||
// SysMenuTreeSelect 使用给定的 SysMenu 对象解析为 TreeSelect 对象
|
||||
func SysMenuTreeSelect(sysMenu model.SysMenu) TreeSelect {
|
||||
t := TreeSelect{}
|
||||
t.ID = sysMenu.MenuId
|
||||
t.Label = sysMenu.MenuName
|
||||
|
||||
if len(sysMenu.Children) > 0 {
|
||||
for _, menu := range sysMenu.Children {
|
||||
child := SysMenuTreeSelect(menu)
|
||||
t.Children = append(t.Children, child)
|
||||
}
|
||||
} else {
|
||||
t.Children = []TreeSelect{}
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
|
||||
// SysDeptTreeSelect 使用给定的 SysDept 对象解析为 TreeSelect 对象
|
||||
func SysDeptTreeSelect(sysDept model.SysDept) TreeSelect {
|
||||
t := TreeSelect{}
|
||||
t.ID = sysDept.DeptId
|
||||
t.Label = sysDept.DeptName
|
||||
|
||||
if len(sysDept.Children) > 0 {
|
||||
for _, dept := range sysDept.Children {
|
||||
child := SysDeptTreeSelect(dept)
|
||||
t.Children = append(t.Children, child)
|
||||
}
|
||||
} else {
|
||||
t.Children = []TreeSelect{}
|
||||
}
|
||||
|
||||
return t
|
||||
}
|
||||
Reference in New Issue
Block a user