Documentation ¶
Index ¶
- type API
- func (a *API) CreateAPI() (err error)
- func (a *API) DeleteAPI() (err error)
- func (a *API) GetAPIByID(id float64) (api API, err error)
- func (a *API) GetAllAPIs() (apis []API, err error)
- func (a *API) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
- func (a *API) UpdataAPI() (err error)
- type APIAuthority
- type Authority
- type BaseMenu
- func (b *BaseMenu) AddBaseMenu() (err error)
- func (b *BaseMenu) DeleteBaseMenu(id float64) (err error)
- func (b *BaseMenu) GetBaseMenuByID(id float64) (menu BaseMenu, err error)
- func (b *BaseMenu) GetBaseMenuTree() (menus []BaseMenu, err error)
- func (b *BaseMenu) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
- func (b *BaseMenu) UpdataBaseMenu() (err error)
- type Menu
- type Meta
- type User
- func (u *User) ChangePassword(newPassword string) (userInter *User, err error)
- func (u *User) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
- func (u *User) Login() (userInter *User, err error)
- func (u *User) Regist() (userInter *User, err error)
- func (u *User) SetUserAuthority(uuid uuid.UUID, AuthorityID string) (err error)
- func (u *User) UploadHeaderImg(uuid uuid.UUID, filePath string) (userInter *User, err error)
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"` Description string `json:"description"` Group string `json:"group"` }
API ...
func (*API) GetInfoList ¶
func (a *API) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
GetInfoList 分页获取数据 需要分页实现这个接口即可
type APIAuthority ¶
type APIAuthority struct { gorm.Model AuthorityID string Authority Authority `gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"` //其实没有关联的必要 APIID uint API API }
APIAuthority ...
func (*APIAuthority) GetAuthAndAPI ¶
func (a *APIAuthority) GetAuthAndAPI(authID string) (apiIds []uint, err error)
GetAuthAndAPI 获取角色api关联关系
func (*APIAuthority) SetAuthAndAPI ¶
func (a *APIAuthority) SetAuthAndAPI(authID string, apisid []uint) (err error)
SetAuthAndAPI 创建角色api关联关系
type Authority ¶
type Authority struct { gorm.Model AuthorityID string `json:"authorityId" gorm:"not null;unique"` AuthorityName string `json:"authorityName"` }
Authority ...
func (*Authority) CreateAuthority ¶
CreateAuthority 创建角色
func (*Authority) DeleteAuthority ¶
DeleteAuthority 删除角色
func (*Authority) GetInfoList ¶
func (a *Authority) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
GetInfoList 分页获取数据 需要分页实现这个接口即可
type BaseMenu ¶
type BaseMenu struct { gorm.Model MenuLevel uint `json:"-"` ParentID string `json:"parentId"` Path string `json:"path"` Name string `json:"name"` Hidden bool `json:"hidden"` Component string `json:"component"` Meta `json:"meta"` NickName string `json:"nickName"` Children []BaseMenu `json:"children"` }
BaseMenu ...
func (*BaseMenu) DeleteBaseMenu ¶
DeleteBaseMenu ...
func (*BaseMenu) GetBaseMenuByID ¶
GetBaseMenuByID ...
func (*BaseMenu) GetBaseMenuTree ¶
GetBaseMenuTree 获取基础路由树
func (*BaseMenu) GetInfoList ¶
func (b *BaseMenu) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
GetInfoList ...
func (*BaseMenu) UpdataBaseMenu ¶
UpdataBaseMenu ...
type Menu ¶
type Menu struct { BaseMenu MenuID string `json:"menuId"` AuthorityID string `json:"-"` Children []Menu `json:"children"` }
Menu 需要构建的点有点多 这里关联关系表直接把所有数据拿过来 用代码实现关联 后期实现主外键模式
func (*Menu) AddMenuAuthority ¶
AddMenuAuthority 为角色增加menu树
func (*Menu) GetMenuAuthority ¶
GetMenuAuthority 查看当前角色树
type User ¶
type User struct { gorm.Model UUID uuid.UUID `json:"uuid"` Username string `json:"userName"` Password string `json:"-"` NickName string `json:"nickName" gorm:"default:'QMPlusUser'"` HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"` Authority Authority `json:"authority" gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"` AuthorityID string `json:"-" gorm:"default:888"` }
User ...
func (*User) ChangePassword ¶
ChangePassword 修改用户密码
func (*User) GetInfoList ¶
func (u *User) GetInfoList(info modelinterface.PageInfo) (list interface{}, total int, err error)
GetInfoList 分页获取数据 需要分页实现这个接口即可
func (*User) SetUserAuthority ¶
SetUserAuthority 用户更新接口
Click to show internal directories.
Click to hide internal directories.