fix top menu

This commit is contained in:
2026-03-26 13:51:38 +01:00
parent 30c1278254
commit 94cb8123d5
3 changed files with 50 additions and 206 deletions

View File

@@ -1,15 +1,15 @@
package model
type B2BTopMenu struct {
MenuID int `gorm:"column:menu_id;primaryKey;autoIncrement"`
Label string `gorm:"column:label;type:longtext;not null;default:'{}'"`
ParentID *int `gorm:"column:parent_id;index:FK_b2b_top_menu_parent_id"`
Params string `gorm:"column:params;type:longtext;not null;default:'{}'"`
Active int8 `gorm:"column:active;type:tinyint;not null;default:1"`
Position int `gorm:"column:position;not null;default:1"`
MenuID int `gorm:"column:menu_id;primaryKey;autoIncrement" json:"menu_id"`
Label string `gorm:"column:label;type:longtext;not null;default:'{}'" json:"label"`
ParentID *int `gorm:"column:parent_id;index:FK_b2b_top_menu_parent_id" json:"parent_id,omitempty"`
Params string `gorm:"column:params;type:longtext;not null;default:'{}'" json:"params"`
Active int8 `gorm:"column:active;type:tinyint;not null;default:1" json:"active"`
Position int `gorm:"column:position;not null;default:1" json:"position"`
Parent *B2BTopMenu `gorm:"foreignKey:ParentID;references:MenuID;constraint:OnDelete:RESTRICT,OnUpdate:RESTRICT"`
Children []B2BTopMenu `gorm:"foreignKey:ParentID"`
Parent *B2BTopMenu `gorm:"foreignKey:ParentID;references:MenuID;constraint:OnDelete:RESTRICT,OnUpdate:RESTRICT" json:"parent,omitempty"`
Children []B2BTopMenu `gorm:"foreignKey:ParentID" json:"children,omitempty"`
}
func (B2BTopMenu) TableName() string {