store

package
v0.0.0-...-c676f21 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	SysUser() SysUserStore
	SysRole() SysRoleStore
	SysMenu() SysMenuStore
	SysApi() SysApiStore
	// Create values必须是指针
	Create(values interface{}) error
	// BatchDelete value必须是指针
	BatchDelete(ids []uint64, value interface{}) error
	// Update values必须是指针
	Update(values interface{}) error
	// GetById value必须是指针
	GetById(id uint64, value interface{}) error
	// GetList value必须是指针,result必须是指针
	GetList(value interface{}, result interface{}, whereOrders ...model.WhereOrder) error
	// GetPage value必须是指针,result必须是指针
	GetPage(pageIndex int, pageSize int, value interface{}, result interface{}, whereOrder ...model.WhereOrder) (int64, error)
}

Factory defines the my-admin storage interface

func NewSqlFactory

func NewSqlFactory(db *gorm.DB) (Factory, error)

NewSqlFactory 单例 获取factory

type SysApiStore

type SysApiStore interface {
}

type SysMenuStore

type SysMenuStore interface {
	GetByPath(path string) (*model.SysMenu, error)
	GetSome(ids []uint64) ([]model.SysMenu, error)
}

type SysRoleStore

type SysRoleStore interface {
	UpdateMenuForRole(cd *model.CreateDelete) error
	GetByName(name string) (*model.SysRole, error)
}

type SysUserStore

type SysUserStore interface {
	UpdateRoleForUser(cd *model.CreateDelete) error
	GetByUsername(username string) (*model.SysUser, error)
	Login(username, password string) (*model.SysUser, error)
}

SysUserStore defines the user storage interface.

Jump to

Keyboard shortcuts

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