This commit is contained in:
Logan committed 2026-07-09 14:16:56 +08:00
1 parent 0690285147
commit 5618cd2738
154 files changed
+5021 -3161

No files matched your search

+23 -24
View File
@@ -2,21 +2,20 @@ package model
import (
"time"
)
// NavigationGroup 导航分组模型
type NavigationGroup struct {
ID uint `gorm:"primarykey" json:"id"`
Name string `gorm:"size:64;not null" json:"name"`
Code string `gorm:"size:64;uniqueIndex;not null" json:"code"`
Description string `gorm:"size:255" json:"description"`
Icon string `gorm:"size:64" json:"icon"`
Sort int `gorm:"default:0" json:"sort"`
Enabled bool `gorm:"default:true" json:"enabled"`
LinkCount int `gorm:"default:0" json:"link_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID uint `gorm:"primarykey" json:"id"`
Name string `gorm:"size:64;not null" json:"name"`
Code string `gorm:"size:64;uniqueIndex;not null" json:"code"`
Description string `gorm:"size:255" json:"description"`
Icon string `gorm:"size:64" json:"icon"`
Sort int `gorm:"default:0" json:"sort"`
Enabled bool `gorm:"default:true" json:"enabled"`
LinkCount int `gorm:"default:0" json:"link_count"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// TableName 表名
@@ -26,18 +25,18 @@ func (NavigationGroup) TableName() string {
// NavigationLink 导航链接模型
type NavigationLink struct {
ID uint `gorm:"primarykey" json:"id"`
GroupID uint `json:"group_id"`
Name string `gorm:"size:128;not null" json:"name"`
URL string `gorm:"size:500;not null" json:"url"`
Description string `gorm:"size:255" json:"description"`
Icon string `gorm:"size:64" json:"icon"`
Tags string `gorm:"type:text" json:"tags"` // JSON
IsFavorite bool `gorm:"default:false" json:"is_favorite"`
Sort int `gorm:"default:0" json:"sort"`
Enabled bool `gorm:"default:true" json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID uint `gorm:"primarykey" json:"id"`
GroupID uint `json:"group_id"`
Name string `gorm:"size:128;not null" json:"name"`
URL string `gorm:"size:500;not null" json:"url"`
Description string `gorm:"size:255" json:"description"`
Icon string `gorm:"size:64" json:"icon"`
Tags string `gorm:"type:text" json:"tags"` // JSON
IsFavorite bool `gorm:"default:false" json:"is_favorite"`
Sort int `gorm:"default:0" json:"sort"`
Enabled bool `gorm:"default:true" json:"enabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// 关联
Group *NavigationGroup `json:"group,omitempty"`
@@ -45,7 +44,7 @@ type NavigationLink struct {
// TableName 表名
func (NavigationLink) TableName() string {
return "navigation_links"
return "sys_navigation_links"
}
// CreateNavigationGroupRequest 创建导航分组请求