Documentation
¶
Index ¶
- type Menu
- type MenuAction
- type MenuActionQueryParam
- type MenuActionQueryResult
- type MenuActionResource
- type MenuActionResourceQueryParam
- type MenuActionResourceQueryResult
- type MenuActionResources
- type MenuActions
- type MenuQueryParam
- type MenuQueryResult
- type MenuTree
- type MenuTrees
- type Menus
- func (a Menus) FillMenuAction(mActions map[string]MenuActions, mResources map[string]MenuActionResources) Menus
- func (a Menus) Len() int
- func (a Menus) Less(i, j int) bool
- func (a Menus) SplitParentIDs() []string
- func (a Menus) Swap(i, j int)
- func (a Menus) ToIDs() []string
- func (a Menus) ToMap() map[string]*Menu
- func (a Menus) ToMenuTrees() MenuTrees
- type Role
- type RoleMenu
- type RoleMenuQueryParam
- type RoleMenuQueryResult
- type RoleMenus
- type RoleQueryParam
- type RoleQueryResult
- type Roles
- type User
- type UserInfo
- type UserQueryParam
- type UserQueryResult
- type UserRole
- type UserRoleQueryParam
- type UserRoleQueryResult
- type UserRoles
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Menu ¶
type Menu struct {
database.Model
ID string `gorm:"column:id;size:36;not null;index;" json:"id"`
Name string `gorm:"column:name;not null;index;" json:"name" validate:"required"`
Sequence int `gorm:"column:sequence;not null;index;" json:"sequence" validate:"required"`
Icon string `gorm:"column:icon;" json:"icon" validate:"required"`
Router string `gorm:"column:router;" json:"router"`
Component string `gorm:"column:component;" json:"component"`
ParentID string `gorm:"column:parent_id;size:36;index;" json:"parent_id"`
ParentPath string `gorm:"column:parent_path;" json:"parent_path"`
Hidden int `gorm:"column:hidden;not null;" json:"hidden" validate:"required,max=1,min=-1"`
Status int `gorm:"column:status;not null;" json:"status" validate:"required,max=1,min=-1"`
Remark string `gorm:"column:remark;" json:"remark" validate:"required"`
CreatedBy string `gorm:"column:created_by;not null;" json:"created_by"`
Actions MenuActions `gorm:"-" json:"actions,omitempty"`
}
ShowStatus - 1: show; -1: hide; Status - 1: Enable -1: Disable
type MenuAction ¶
type MenuAction struct {
database.Model
ID string `gorm:"column:id;size:36;not null;index;" json:"id" yaml:"-"`
MenuID string `gorm:"column:menu_id;size:36;not null;index;" json:"menu_id" yaml:"-"`
Code string `gorm:"column:code;not null;" json:"code" validate:"required" yaml:"code"`
Name string `gorm:"column:name;not null;" json:"name" validate:"required" yaml:"name"`
Resources MenuActionResources `gorm:"-" json:"resources" yaml:"resources"`
}
type MenuActionQueryParam ¶
type MenuActionQueryParam struct {
dto.PaginationParam
dto.OrderParam
MenuID string
IDs []string
}
type MenuActionQueryResult ¶
type MenuActionQueryResult struct {
List MenuActions `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type MenuActionResource ¶
type MenuActionResource struct {
database.Model
ID string `gorm:"column:id;size:36;index;not null;" json:"-" yaml:"-"`
ActionID string `gorm:"column:action_id;size:36;index;not null;" json:"-" yaml:"-"`
Method string `gorm:"column:method;not null;" json:"method" validate:"required" yaml:"method"`
Path string `gorm:"column:path;not null;" json:"path" validate:"required" yaml:"path"`
}
type MenuActionResourceQueryParam ¶
type MenuActionResourceQueryParam struct {
dto.PaginationParam
dto.OrderParam
MenuID string
MenuIDs []string
}
type MenuActionResourceQueryResult ¶
type MenuActionResourceQueryResult struct {
List MenuActionResources `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type MenuActionResources ¶
type MenuActionResources []*MenuActionResource
func (MenuActionResources) ToActionIDMap ¶
func (a MenuActionResources) ToActionIDMap() map[string]MenuActionResources
func (MenuActionResources) ToMap ¶
func (a MenuActionResources) ToMap() map[string]*MenuActionResource
type MenuActions ¶
type MenuActions []*MenuAction
func (MenuActions) FillResources ¶
func (a MenuActions) FillResources(maResources map[string]MenuActionResources)
func (MenuActions) ToMap ¶
func (a MenuActions) ToMap() map[string]*MenuAction
func (MenuActions) ToMenuIDMap ¶
func (a MenuActions) ToMenuIDMap() map[string]MenuActions
type MenuQueryParam ¶
type MenuQueryParam struct {
dto.PaginationParam
dto.OrderParam
IDs []string `query:"ids"`
Name string `query:"name"`
PrefixParentPath string `query:"prefix_parent_path"`
QueryValue string `query:"query_value"`
ParentID string `query:"parent_id"`
Hidden int `query:"hidden" validate:"max=1,min=-1"`
Status int `query:"status" validate:"max=1,min=-1"`
Tree bool `query:"tree"`
IncludeActions bool `query:"include_actions"`
}
type MenuQueryResult ¶
type MenuQueryResult struct {
List Menus `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type MenuTree ¶
type MenuTree struct {
ID string `yaml:"-" json:"id"`
Name string `yaml:"name" json:"name"`
Icon string `yaml:"icon" json:"icon"`
Router string `yaml:"router,omitempty" json:"router"`
Component string `yaml:"component,omitempty" json:"component"`
ParentID string `yaml:"-" json:"parent_id"`
ParentPath string `yaml:"-" json:"parent_path"`
Sequence int `yaml:"sequence" json:"sequence"`
Hidden int `yaml:"-" json:"hidden"`
Status int `yaml:"-" json:"status"`
Actions MenuActions `yaml:"actions,omitempty" json:"actions"`
Children MenuTrees `yaml:"children,omitempty" json:"children,omitempty"`
}
type Menus ¶
type Menus []*Menu
func (Menus) FillMenuAction ¶
func (a Menus) FillMenuAction(mActions map[string]MenuActions, mResources map[string]MenuActionResources) Menus
func (Menus) SplitParentIDs ¶
func (Menus) ToMenuTrees ¶
type Role ¶
type Role struct {
database.Model
ID string `gorm:"column:id;size:36;not null;index;" json:"id"`
Name string `gorm:"column:name;not null;" json:"name" validate:"required"`
Remark string `gorm:"column:remark;not null;" json:"remark" validate:"required"`
Sequence int `gorm:"column:sequence;index;not null;" json:"sequence" validate:"required"`
Status int `gorm:"column:status;default:0;not null;" json:"status" validate:"required,max=1,min=-1"`
CreatedBy string `gorm:"column:created_by;not null;" json:"created_by"`
RoleMenus RoleMenus `gorm:"-" json:"role_menus"`
}
Status - 1: Enable -1: Disable
type RoleMenu ¶
type RoleMenu struct {
database.Model
ID string `gorm:"column:id;size:36;not null;" json:"id"`
RoleID string `gorm:"column:role_id;size:36;not null;index;" json:"role_id" validate:"required"`
MenuID string `gorm:"column:menu_id;size:36;not null;index;" json:"menu_id" validate:"required"`
ActionID string `gorm:"column:action_id;size:36;not null;index;" json:"action_id" validate:"required"`
}
type RoleMenuQueryParam ¶
type RoleMenuQueryParam struct {
dto.PaginationParam
dto.OrderParam
RoleID string
RoleIDs []string
}
type RoleMenuQueryResult ¶
type RoleMenuQueryResult struct {
List RoleMenus `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type RoleMenus ¶
type RoleMenus []*RoleMenu
func (RoleMenus) ToActionIDs ¶
func (RoleMenus) ToRoleIDMap ¶
type RoleQueryParam ¶
type RoleQueryParam struct {
dto.PaginationParam
dto.OrderParam
IDs []string `query:"ids"`
Name string `query:"name"`
QueryValue string `query:"query_value"`
UserID string `query:"user_id"`
Status int `query:"status" validate:"max=1,min=-1"`
}
type RoleQueryResult ¶
type RoleQueryResult struct {
List Roles `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type User ¶
type User struct {
database.Model
ID string `gorm:"column:id;size:36;index;not null;" json:"id"`
Username string `gorm:"column:username;size:64;not null;index;" json:"username" validate:"required"`
Realname string `gorm:"column:realname;size:64;not null;" json:"realname" validate:"required"`
Password string `gorm:"column:password;not null;" json:"password" json:"phone"`
Email string `gorm:"column:email;default:'';" json:"email"`
Phone string `gorm:"column:phone;default:'';" json:"phone"`
Status int `gorm:"column:status;not null;default:0;" json:"status" validate:"required,max=1,min=-1"`
CreatedBy string `gorm:"column:created_by;not null;" json:"created_by"`
UserRoles UserRoles `gorm:"-" json:"user_roles"`
}
Status - 1: Enable 0: Disable
func (*User) CleanSecure ¶
type UserQueryParam ¶
type UserQueryParam struct {
dto.PaginationParam
dto.OrderParam
QueryPassword bool
Username string `query:"username"`
Realname string `query:"realname"`
QueryValue string `query:"query_value"`
Status int `query:"status" validate:"max=1,min=-1"`
RoleIDs []string `query:"-"`
}
type UserQueryResult ¶
type UserQueryResult struct {
List Users `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
type UserRoleQueryParam ¶
type UserRoleQueryParam struct {
dto.PaginationParam
dto.OrderParam
UserID string
UserIDs []string
}
type UserRoleQueryResult ¶
type UserRoleQueryResult struct {
List UserRoles `json:"list"`
Pagination *dto.Pagination `json:"pagination"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.