Documentation ¶
Index ¶
- func TransSetUpdate(data metadata.MapStr) *bson.D
- type Account
- func (a *Account) ChangePassword(ctx context.Context, cipher string) error
- func (a *Account) Create(ctx context.Context) error
- func (a *Account) Delete(ctx context.Context, cond *metadata.Condition) error
- func (a *Account) GetInfo(ctx context.Context, cond *metadata.Condition) (*AccountInfo, error)
- func (a *Account) GetInfoById(ctx context.Context, id int64) (*AccountInfo, error)
- func (a *Account) GetInfoByUsername(ctx context.Context, username string) (*AccountInfo, error)
- func (a *Account) GetList(ctx context.Context, cond *metadata.Condition) ([]Account, error)
- func (a *Account) GetPageList(ctx context.Context, cond *metadata.Condition) (*metadata.PageData, error)
- func (a *Account) SearchByName(ctx context.Context, username string) error
- func (a *Account) Update(ctx context.Context, data metadata.MapStr) error
- type AccountInfo
- type BaseModel
- type PrivilegeActionModel
- type PrivilegeRecordModel
- type ProjectModel
- func (p *ProjectModel) Create(ctx context.Context) error
- func (p *ProjectModel) GetDetail(ctx context.Context, cond *metadata.Condition) error
- func (p *ProjectModel) GetList(ctx context.Context, cond *metadata.Condition) ([]ProjectModel, error)
- func (p *ProjectModel) GetPageList(ctx context.Context, cond *metadata.Condition) (*metadata.PageData, error)
- func (p *ProjectModel) Update(ctx context.Context, cond *metadata.Condition, data metadata.MapStr) error
- type RoleModel
- type RolesAccountsModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶
type Account struct { BaseModel `json:",inline" bson:",inline"` Username string `json:"username" bson:"username"` Nickname string `json:"nickname" bson:"nickname"` Password string `json:"password" bson:"password"` Email string `json:"email" bson:"email"` Enabled bool `json:"enable" bson:"enable"` IsSuperuser bool `json:"is_superuser" bson:"is_supersor"` IsAdmin bool `json:"is_admin" bson:"is_admin"` }
func AccountManager ¶
func AccountManager() *Account
func (*Account) ChangePassword ¶
func (*Account) GetInfoById ¶
func (*Account) GetInfoByUsername ¶
func (*Account) GetPageList ¶
func (*Account) SearchByName ¶
type AccountInfo ¶
type AccountInfo struct { *Account `json:",inline"` Roles []string `json:"roles"` Actions []PrivilegeActionModel `json:"actions"` }
type BaseModel ¶
type PrivilegeActionModel ¶
type PrivilegeActionModel struct { BaseModel `json:",inline" bson:",inline"` Name string `json:"name" bson:"name"` Desc string `json:"desc" bson:"desc"` CateEn string `json:"cate_en" bson:"cate_en"` // 类别英文描述 CateCh string `json:"cate_ch" bson:"cate_ch"` // 类别中文描述 NeedResource bool `json:"need_resource" bson:"need_resource"` // 是否需要资源绑定 Method string `json:"method" bson:"method"` // http 方法 Url string `json:"url" bson:"url"` // 接口url }
权限动作模型
type PrivilegeRecordModel ¶
type PrivilegeRecordModel struct { BaseModel `json:",inline" bson:",inline"` ItemId int64 `json:"itemid" bson:"itemid"` // 记录用户或者角色的id ResourceId int64 `json:"resourceid" bson:"resourceid"` // 资源ID,0为所有资源 ActionId int64 `json:"actionid" bson:"actionid"` }
权限记录模型
type ProjectModel ¶
type ProjectModel struct { BaseModel `json:",inline" bson:",inline"` Name string `json:"name" bson:"name"` Desc string `json:"desc" bson:"desc"` Owner string `json:"owner" bson:"owner"` Status string `json:"status" bson:"status"` }
func ProjectManager ¶
func ProjectManager() *ProjectModel
func (*ProjectModel) GetList ¶
func (p *ProjectModel) GetList(ctx context.Context, cond *metadata.Condition) ([]ProjectModel, error)
func (*ProjectModel) GetPageList ¶
type RolesAccountsModel ¶
Click to show internal directories.
Click to hide internal directories.