2021-12-16 15:07:53 +08:00
|
|
|
|
package model
|
|
|
|
|
|
|
|
|
|
// SysNavigation 自定义导航栏数据模型
|
|
|
|
|
type SysNavigation struct {
|
|
|
|
|
Model
|
2022-01-12 17:29:05 +08:00
|
|
|
|
ModelTenant
|
2021-12-16 15:07:53 +08:00
|
|
|
|
ParentID uint64 `gorm:"column:parent_id;type:int;default:0;comment:父级ID" json:"parent_id"`
|
|
|
|
|
Title string `gorm:"column:title;type:varchar(20);default:'';comment:区域名称" json:"title"`
|
|
|
|
|
Link string `gorm:"column:link;type:varchar(255);default:'';comment:访问地址" json:"link"`
|
2022-01-12 17:29:05 +08:00
|
|
|
|
IsTarget int `gorm:"column:is_target;type:tinyint(1);default:0;comment:是否新窗口打开(0:否,1:是)" json:"is_target"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:tinyint(3);default:0;comment:排序,从小到小" json:"-"`
|
2022-01-19 10:59:43 +08:00
|
|
|
|
Status SysNavigationStatus `gorm:"column:status;type:tinyint(1);default:1;comment:状态" json:"status"`
|
2021-12-16 15:07:53 +08:00
|
|
|
|
ModelDeleted
|
|
|
|
|
ModelAt
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SysNavigationStatus 显示状态
|
|
|
|
|
type SysNavigationStatus int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
// SysNavigationStatusForShow 显示
|
|
|
|
|
SysNavigationStatusForShow SysNavigationStatus = iota + 1
|
|
|
|
|
// SysNavigationStatusForHidden 隐藏
|
|
|
|
|
SysNavigationStatusForHidden
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (m *SysNavigation) TableName() string {
|
|
|
|
|
return "sys_navigation"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func NewSysNavigation() *SysNavigation {
|
|
|
|
|
return &SysNavigation{}
|
|
|
|
|
}
|