models

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base added in v0.0.5

type Base struct {
	Table string
}
type MenuModel struct {
	Base

	Id        int64
	Title     string
	ParentId  int64
	Icon      string
	Uri       string
	Header    string
	CreatedAt string
	UpdatedAt string
}
func Menu() MenuModel
func MenuWithId(id string) MenuModel
func (t MenuModel) AddRole(roleId string)
func (t MenuModel) CheckRole(roleId string) bool
func (t MenuModel) Delete()
func (t MenuModel) DeleteRoles()
func (t MenuModel) Find(id interface{}) MenuModel
func (t MenuModel) MapToModel(m map[string]interface{}) MenuModel
func (t MenuModel) New(title, icon, uri, header string, parentId, order int64) MenuModel
func (t MenuModel) ResetOrder(data []map[string]interface{})
func (t MenuModel) Update(title, icon, uri, header string, parentId int64) MenuModel

type OperationLogModel added in v0.0.5

type OperationLogModel struct {
	Base

	Id        int64
	UserId    int64
	Path      string
	Method    string
	Ip        string
	Input     string
	CreatedAt string
	UpdatedAt string
}

func OperationLog added in v0.0.5

func OperationLog() OperationLogModel

func (OperationLogModel) Find added in v0.0.5

func (t OperationLogModel) Find(id interface{}) OperationLogModel

func (OperationLogModel) MapToModel added in v0.0.5

func (t OperationLogModel) MapToModel(m map[string]interface{}) OperationLogModel

func (OperationLogModel) New added in v0.0.5

func (t OperationLogModel) New(userId int64, path, method, ip, input string) OperationLogModel

type PermissionModel added in v0.0.5

type PermissionModel struct {
	Base

	Id         int64
	Name       string
	Slug       string
	HttpMethod []string
	HttpPath   []string
	CreatedAt  string
	UpdatedAt  string
}

func Permission added in v0.0.5

func Permission() PermissionModel

func PermissionWithId added in v0.0.5

func PermissionWithId(id string) PermissionModel

func (PermissionModel) Find added in v0.0.5

func (t PermissionModel) Find(id interface{}) PermissionModel

func (PermissionModel) MapToModel added in v0.0.5

func (t PermissionModel) MapToModel(m map[string]interface{}) PermissionModel

type RoleModel added in v0.0.5

type RoleModel struct {
	Base

	Id        int64
	Name      string
	Slug      string
	CreatedAt string
	UpdatedAt string
}

func Role added in v0.0.5

func Role() RoleModel

func RoleWithId added in v0.0.5

func RoleWithId(id string) RoleModel

func (RoleModel) AddPermission added in v0.0.5

func (t RoleModel) AddPermission(permissionId string)

func (RoleModel) CheckPermission added in v0.0.5

func (t RoleModel) CheckPermission(permissionId string) bool

func (RoleModel) DeletePermissions added in v0.1.0

func (t RoleModel) DeletePermissions()

func (RoleModel) Find added in v0.0.5

func (t RoleModel) Find(id interface{}) RoleModel

func (RoleModel) MapToModel added in v0.0.5

func (t RoleModel) MapToModel(m map[string]interface{}) RoleModel

func (RoleModel) New added in v0.0.5

func (t RoleModel) New(name, slug string) RoleModel

func (RoleModel) Update added in v0.0.5

func (t RoleModel) Update(name, slug string) RoleModel

type UserModel added in v0.0.5

type UserModel struct {
	Base `json:"-"`

	Id            int64             `json:"id"`
	Name          string            `json:"name"`
	UserName      string            `json:"user_name"`
	Password      string            `json:"password"`
	Avatar        string            `json:"avatar"`
	RememberToken string            `json:"remember_token"`
	Permissions   []PermissionModel `json:"permissions"`
	MenuIds       []int64           `json:"menu_ids"`
	Role          RoleModel         `json:"role"`
	Level         string            `json:"level"`
	LevelName     string            `json:"level_name"`

	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

func User added in v0.0.5

func User() UserModel

func UserWithId added in v0.0.5

func UserWithId(id string) UserModel

func (UserModel) AddPermission added in v0.0.5

func (t UserModel) AddPermission(permissionId string)

func (UserModel) AddRole added in v0.0.5

func (t UserModel) AddRole(roleId string)

func (UserModel) CheckPermission added in v0.0.5

func (t UserModel) CheckPermission(permissionId string) bool

func (UserModel) CheckRole added in v0.0.5

func (t UserModel) CheckRole(roleId string) bool

func (UserModel) DeleteRoles added in v0.1.0

func (t UserModel) DeleteRoles()

func (UserModel) Find added in v0.0.5

func (t UserModel) Find(id interface{}) UserModel

func (UserModel) FindByUserName added in v0.0.5

func (t UserModel) FindByUserName(username interface{}) UserModel

func (UserModel) IsEmpty added in v0.0.5

func (t UserModel) IsEmpty() bool

func (UserModel) IsSuperAdmin added in v0.0.5

func (t UserModel) IsSuperAdmin() bool

func (UserModel) MapToModel added in v0.0.5

func (t UserModel) MapToModel(m map[string]interface{}) UserModel

func (UserModel) New added in v0.0.5

func (t UserModel) New(username, password, name, avatar string) UserModel

func (UserModel) Update added in v0.0.5

func (t UserModel) Update(username, password, name, avatar string) UserModel

func (UserModel) UpdateAvatar added in v0.0.5

func (t UserModel) UpdateAvatar(avatar string)

func (UserModel) UpdatePwd added in v0.0.5

func (t UserModel) UpdatePwd(password string) UserModel

func (UserModel) WithMenus added in v0.0.5

func (t UserModel) WithMenus() UserModel

func (UserModel) WithPermissions added in v0.0.5

func (t UserModel) WithPermissions() UserModel

func (UserModel) WithRoles added in v0.0.5

func (t UserModel) WithRoles() UserModel

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL