Documentation
¶
Index ¶
- type ErrorItem
- type ErrorResult
- type HealthCheck
- type IDResult
- type ListResult
- type LoginCaptcha
- type LoginTokenInfo
- type Menu
- type MenuAction
- type MenuActionQueryResult
- type MenuActionResource
- type MenuActionResourceQueryResult
- type MenuActionResources
- type MenuActions
- type MenuQueryResult
- type MenuTree
- type MenuTrees
- type Menus
- type Role
- type RoleMenu
- type RoleMenuQueryResult
- type RoleMenus
- type RoleQueryResult
- type Roles
- type StatusResult
- type StatusText
- type User
- type UserLoginInfo
- type UserQueryResult
- type UserRole
- type UserRoleQueryResult
- type UserRoles
- type UserShow
- type UserShowQueryResult
- type UserShows
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorResult ¶
type ErrorResult struct {
Error ErrorItem `json:"error"` // Error
}
type HealthCheck ¶
type ListResult ¶
type ListResult struct { List interface{} `json:"list"` // List Pagination *pagination.Pagination `json:"pagination,omitempty"` // Pagination }
type LoginCaptcha ¶
type LoginCaptcha struct {
CaptchaID string `json:"captcha_id"` // Captcha ID
}
type LoginTokenInfo ¶
type Menu ¶
type Menu struct { ID string `json:"id"` // ID Name string `json:"name" binding:"required"` // Name Sequence int `json:"sequence"` // Sequence Icon string `json:"icon"` // Icon Router string `json:"router"` // Router ParentID string `json:"parent_id"` // Parent ID ParentPath string `json:"parent_path"` // Parent Path ShowStatus int `json:"show_status" binding:"required,max=2,min=1"` // Show Status(1:show 2:hide) Status int `json:"status" binding:"required,max=2,min=1"` // Menu Status(1:enable 2:disable) Memo string `json:"memo"` // Memo Creator string `json:"creator"` // Creator CreatedAt time.Time `json:"created_at"` // CreatedAt UpdatedAt time.Time `json:"updated_at"` // UpdatedAt Actions MenuActions `json:"actions"` // Actions }
func MenuFromDomain ¶
type MenuAction ¶
type MenuAction struct { ID string `yaml:"-" json:"id"` MenuID string `yaml:"-" binding:"required" json:"menu_id"` Code string `yaml:"code" binding:"required" json:"code"` Name string `yaml:"name" binding:"required" json:"name"` Resources MenuActionResources `yaml:"resources,omitempty" json:"resources"` }
type MenuActionQueryResult ¶
type MenuActionQueryResult struct { Data MenuActions PageResult *pagination.Pagination }
type MenuActionResource ¶
type MenuActionResourceQueryResult ¶
type MenuActionResourceQueryResult struct { Data MenuActionResources PageResult *pagination.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(mResources map[string]MenuActionResources)
func (MenuActions) ToMap ¶
func (a MenuActions) ToMap() map[string]*MenuAction
func (MenuActions) ToMenuIDMap ¶
func (a MenuActions) ToMenuIDMap() map[string]MenuActions
type MenuQueryResult ¶
type MenuQueryResult struct { Data Menus PageResult *pagination.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"` ParentID string `yaml:"-" json:"parent_id"` ParentPath string `yaml:"-" json:"parent_path"` Sequence int `yaml:"sequence" json:"sequence"` ShowStatus int `yaml:"-" json:"show_status"` // 1:show 2:hide Status int `yaml:"-" json:"status"` // 1:enable 2:disable Actions MenuActions `yaml:"actions,omitempty" json:"actions"` Children *MenuTrees `yaml:"children,omitempty" json:"children,omitempty"` }
type Menus ¶
type Menus []*Menu
func MenusFromDomain ¶
func (Menus) FillMenuAction ¶
func (a Menus) FillMenuAction(mActions map[string]MenuActions) Menus
func (Menus) SplitParentIDs ¶
type Role ¶
type Role struct { ID string `json:"id"` // ID Name string `json:"name"` // Name Sequence int `json:"sequence"` // Sequence Memo string `json:"memo"` // Memo Status int `json:"status"` // Status(1:enable 2:disable) Creator string `json:"creator"` // Creator CreatedAt time.Time `json:"created_at"` // CreatedAt UpdatedAt time.Time `json:"updated_at"` // UpdatedAt RoleMenus RoleMenus `json:"role_menus"` // RoleMenus }
func RoleFromDomain ¶
type RoleMenuQueryResult ¶
type RoleMenuQueryResult struct { Data RoleMenus PageResult *pagination.Pagination }
type RoleMenus ¶
type RoleMenus []*RoleMenu
func (RoleMenus) ToActionIDs ¶
func (RoleMenus) ToRoleIDMap ¶
type RoleQueryResult ¶
type RoleQueryResult struct { Data Roles PageResult *pagination.Pagination }
type StatusResult ¶
type StatusResult struct {
Status StatusText `json:"status"` // Result status
}
type StatusText ¶
type StatusText string
const ( OKStatus StatusText = "OK" ErrorStatus StatusText = "ERROR" FailStatus StatusText = "FAIL" )
func (StatusText) String ¶
func (t StatusText) String() string
type User ¶
type User struct { ID string `json:"id"` // ID UserName string `json:"user_name" binding:"required"` // User Name RealName string `json:"real_name" binding:"required"` // Real Name Password string `json:"password"` // Password Phone string `json:"phone"` // Phone Email string `json:"email"` // Email Status int `json:"status" binding:"required,max=2,min=1"` // Status(1:enable 2:disable) Creator string `json:"creator"` // Creator CreatedAt time.Time `json:"created_at"` // CreatedAt UserRoles UserRoles `json:"user_roles" binding:"required,gt=0"` // UserRoles }
func UserFromDomain ¶
func (*User) CleanSecure ¶
type UserLoginInfo ¶
type UserQueryResult ¶
type UserQueryResult struct { Data Users PageResult *pagination.Pagination }
func (UserQueryResult) ToShowResult ¶
func (a UserQueryResult) ToShowResult(mUserRoles map[string]UserRoles, mRoles map[string]*Role) *UserShowQueryResult
type UserRoleQueryResult ¶
type UserRoleQueryResult struct { Data UserRoles PageResult *pagination.Pagination }
type UserShow ¶
type UserShow struct { ID string `json:"id"` // ID UserName string `json:"user_name"` // User Name RealName string `json:"real_name"` // Real Name Phone string `json:"phone"` // Phone Email string `json:"email"` // Email Status int `json:"status"` // Status(1:enable 2:disable) CreatedAt time.Time `json:"created_at"` // CreatedAt Roles []*Role `json:"roles"` // Roles }
type UserShowQueryResult ¶
type UserShowQueryResult struct { Data UserShows PageResult *pagination.Pagination }
Click to show internal directories.
Click to hide internal directories.