Documentation ¶
Index ¶
- func CreateRelationRoleMenu(roleMenu ...*RoleMenu) (int64, error)
- func CreateUser(user ...*User) (int64, error)
- func DeleteByRoles(rids []int64) (effect int64, err error)
- func DeleteByUsers(uids []int64) (effect int64, err error)
- func GetUserByUsername(user *User) (bool, error)
- func UpdateRoleById(role *CasbinRule) (int64, error)
- func UpdateUserById(user *User) (int64, error)
- type CasbinRule
- type Children
- type Demo
- type Menu
- type MenuTreeGroup
- type RoleMenu
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRelationRoleMenu ¶
func CreateUser ¶
func DeleteByRoles ¶
func DeleteByUsers ¶
func GetUserByUsername ¶
func UpdateRoleById ¶
func UpdateRoleById(role *CasbinRule) (int64, error)
func UpdateUserById ¶
Types ¶
type CasbinRule ¶
type CasbinRule struct { Id int64 `xorm:"pk autoincr INT(10) notnull" json:"id" form:"id"` PType string `xorm:"varchar(100) index" json:"p_type"` V0 string `xorm:"varchar(100) index" json:"v0"` V1 string `xorm:"varchar(100) index" json:"v1"` V2 string `xorm:"varchar(100) index" json:"v2"` V3 string `xorm:"varchar(100) index" json:"v3"` V4 string `xorm:"varchar(100) index" json:"v4"` V5 string `xorm:"varchar(100) index" json:"v5"` }
func GetPaginationRoles ¶
func GetPaginationRoles(page *supports.Pagination) ([]*CasbinRule, int64, error)
type Children ¶
type Children struct { Id2 int64 `xorm:"pk autoincr INT(10) notnull" json:"id"` Path2 string `xorm:"varchar(64) notnull" json:"path"` Modular2 string `xorm:"varchar(64) notnull" json:"modular"` Component2 string `xorm:"varchar(64) notnull" json:"component"` Name2 string `xorm:"varchar(64) notnull" json:"name"` Icon2 string `xorm:"varchar(64) notnull" json:"icon"` KeepAlive2 string `xorm:"varchar(64) notnull" json:"keep_alive"` RequireAuth2 string `xorm:"varchar(64) notnull" json:"require_auth"` ParentId2 string `xorm:"INT(10) notnull" json:"parent_id"` Enabled2 string `xorm:"tinyint(1) notnull" json:"enabled"` }
子菜单
type Menu ¶
type Menu struct { Id int64 `xorm:"pk autoincr INT(10) notnull" json:"id"` Path string `xorm:"varchar(64) notnull" json:"path"` Url string `xorm:"varchar(64) notnull" json:"url"` Modular string `xorm:"varchar(64) notnull" json:"modular"` Component string `xorm:"varchar(64) notnull" json:"component"` Name string `xorm:"varchar(64) notnull" json:"name"` Icon string `xorm:"varchar(64) notnull" json:"icon"` KeepAlive string `xorm:"varchar(64) notnull" json:"keep_alive"` RequireAuth string `xorm:"varchar(64) notnull" json:"require_auth"` ParentId string `xorm:"INT(10) notnull" json:"parent_id"` Enabled string `xorm:"tinyint(1) notnull" json:"enabled"` CreateTime time.Time `json:"createTime"` UpdateTime time.Time `json:"updateTime"` Children []Children `xorm:"-" json:"children"` }
菜单表
func GetMenusByRoleid ¶
func GetPaginationMenus ¶
func GetPaginationMenus(page *supports.Pagination) ([]*Menu, int64, error)
type MenuTreeGroup ¶
菜单树
type RoleMenu ¶
type RoleMenu struct { Id int64 `xorm:"pk autoincr INT(10) notnull" json:"id"` Rid int64 `xorm:"pk autoincr INT(10) notnull" json:"rid"` Mid int64 `xorm:"pk autoincr INT(10) notnull" json:"mid"` }
角色-菜单关联表
type User ¶
type User struct { Id int64 `xorm:"pk autoincr INT(10) notnull" json:"id" form:"id"` Username string `xorm:"notnull" json:"username" form:"username"` Password string `xorm:"notnull" json:"password" form:"password"` Enable int `xorm:"notnull tinyint(1)" json:"enable" form:"enable"` Appid string `xorm:"notnull" json:"appid" form:"appid"` Name string `xorm:"notnull" json:"name" form:"name"` Phone string `xorm:"notnull" json:"phone" form:"phone"` Email string `xorm:"notnull" json:"email" form:"email"` Userface string `xorm:"notnull" json:"userface" form:"userface"` CreateTime time.Time `json:"createTime" form:"createTime"` UpdateTime time.Time `json:"updateTime" form:"updateTime"` }
mysql user table
func GetPaginationUsers ¶
func GetPaginationUsers(page *supports.Pagination) ([]*User, int64, error)
func GetUsersByUids ¶
Click to show internal directories.
Click to hide internal directories.