49 lines
1.6 KiB
Go
49 lines
1.6 KiB
Go
package menu
|
|
|
|
import (
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type Menu struct {
|
|
ID primitive.ObjectID `bson:"_id" json:"_id"`
|
|
Display string `bson:"display" json:"display"`
|
|
Child string `bson:"child" json:"child"`
|
|
Ordered int `bson:"ordered" json:"ordered"`
|
|
Parent string `bson:"parent" json:"parent"`
|
|
Icon string `bson:"icon" json:"icon"`
|
|
Link string `bson:"link" json:"link"`
|
|
}
|
|
|
|
type TypeUser struct {
|
|
ID primitive.ObjectID `bson:"_id" json:"_id"`
|
|
Display string `bson:"display" json:"display"`
|
|
Status bool `bson:"status" json:"status"`
|
|
}
|
|
|
|
type Rolemenu struct {
|
|
ID primitive.ObjectID `bson:"_id" json:"_id"`
|
|
TypeUser string `bson:"type_user_id" json:"type_user_id"`
|
|
MenuID string `json:"menu_id" bson:"menu_id"`
|
|
Access []Access `bson:"access" json:"access"`
|
|
}
|
|
|
|
type Access struct {
|
|
Add int `bson:"add" json:"add"`
|
|
Update int `bson:"update" json:"update"`
|
|
Read int `bson:"read" json:"read"`
|
|
Delete int `bson:"delete" json:"delete"`
|
|
}
|
|
|
|
type GroupedRoleMenuFlatWithMenu struct {
|
|
TypeUserID string `json:"type_user_id" bson:"type_user_id"`
|
|
Display string `json:"display" bson:"display"`
|
|
Menus []FlatMenu `json:"menus" bson:"menus"`
|
|
}
|
|
|
|
type FlatMenu struct {
|
|
MenuID string `json:"menu_id" bson:"menu_id"`
|
|
MenuDisplay string `json:"display" bson:"menu_display"`
|
|
MenuIcon string `json:"icon" bson:"menu_icon"`
|
|
MenuLink string `json:"link" bson:"menu_link"`
|
|
}
|