Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
gorm.Model
Path string `json:"path" gorm:"comment:api path"` // api path
Description string `json:"description" gorm:"comment:api description"` // api description
ApiGroup string `json:"apiGroup" gorm:"comment:api group"` // api group
Method string `json:"method" gorm:"default:POST;comment: http method"` // http method
}
type Menu ¶
type Menu struct {
gorm.Model
MenuLevel uint32 `json:"level" gorm:"comment:menu level"`
MenuType uint32 `json:"type" gorm:"comment:menu type: 0. group 1. menu"`
ParentId uint `json:"parentId" gorm:"comment:parent menu id"` // parent menu id
Path string `json:"path" gorm:"comment:index path"` // index path
Name string `json:"name" gorm:"comment:index name"` // index name
Redirect string `json:"redirect" gorm:"comment: redirect path"` // redirect path
Component string `json:"component" gorm:"comment:the path of vue file"` // the path of vue file
OrderNo uint32 `json:"orderNo" gorm:"default:0;comment:numbers for sorting"` // sorting numbers
Disabled bool `json:"disabled" gorm:"default:false;comment:if true, disable;"` //disable status
Meta Meta `json:"meta" gorm:"embedded;comment:extra parameters"` // extra parameters
Roles []Role `json:"roles" gorm:"many2many:role_menus;"`
Children []Menu `json:"children" gorm:"foreignKey:ParentId;references:id"`
Param []MenuParam `json:"parameters"`
}
type MenuParam ¶
type MenuParam struct {
gorm.Model
MenuId uint
Type string `json:"type" gorm:"comment:pass parameters via params or query "` // pass parameters via params or query
Key string `json:"key" gorm:"comment:the key of parameters"` // the key of parameters
Value string `json:"value" gorm:"comment:the value of parameters"` // the value of parameters
}
type Meta ¶
type Meta struct {
KeepAlive bool `json:"keepAlive" gorm:"default:false;comment:save in cache?"` // save in cache
HideMenu bool `json:"hideMenu" gorm:"default:false;comment:hide the menu"` // hide menu
HideBreadcrumb bool `json:"hideBreadcrumb" gorm:"default:true;comment: hide the breadcrumb"` // hide the breadcrumb
CurrentActiveMenu string `json:"currentActiveMenu" gorm:"comment:set the active menu"` // set the active menu
Title string `json:"title" gorm:"comment:menu name"` // menu name
Icon string `json:"icon" gorm:"comment:menu icon"` // menu icon
CloseTab bool `json:"closeTab" gorm:"default:true;comment:auto close tab"` // auto close tab
}
type Role ¶
type Role struct {
gorm.Model
Name string `json:"name" gorm:"comment:role name"`
Value string `json:"value" gorm:"unique;not null;comment: role value for permission control in front end"`
DefaultRouter string `json:"defaultRouter" gorm:"comment:default menu;default:dashboard"` // default menu : dashboard
Status uint32 `json:"status" gorm:"default:0;comment:role status:0 normal, 1 ban"`
Remark string `json:"remark" gorm:"comment:remark"`
OrderNo uint32 `json:"orderNo" gorm:"default:0;comment:number for sorting"`
Menus []Menu `json:"menus" gorm:"many2many:role_menus"`
}
type User ¶
type User struct {
gorm.Model
UUID string `json:"uuid" gorm:"comment:user's UUID"`
Username string `json:"username" gorm:"unique;comment:user's login name'"`
Password string `json:"-" gorm:"comment:password"`
Nickname string `json:"nickName" gorm:"unique;comment:nickname"`
SideMode string `json:"sideMode" gorm:"default:dark;comment:template mode"`
Avatar string `json:"Avatar" gorm:"comment:avatar"`
BaseColor string `json:"baseColor" gorm:"default:#fff;comment:base color of template"`
ActiveColor string `json:"activeColor" gorm:"default:#1890ff;comment:active color of template"`
RoleId uint32 `json:"roleId" gorm:"default:2;comment:user's role id for access control"`
Mobile string `json:"mobile" gorm:"comment:mobile number"`
Email string `json:"email" gorm:"comment:email address"`
Status int32 `json:"status" gorm:"default:1;comment:user status 1: normal 2: ban"`
}
Click to show internal directories.
Click to hide internal directories.