feat: 更新多个模块以支持新的数据结构和日志格式
This commit is contained in:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user