Versions in this module Expand all Collapse all v0 v0.1.1 Feb 25, 2020 v0.1.0 Feb 25, 2020 Changes in this version + func Check(ctx context.Context, db *gorm.DB) (bool, error) + func ExecTrans(ctx context.Context, db *gorm.DB, fn TransFunc) error + func ExecTransWithLock(ctx context.Context, db *gorm.DB, fn TransFunc) error + func FindOne(ctx context.Context, db *gorm.DB, out interface{}) (bool, error) + func FindPage(ctx context.Context, db *gorm.DB, pageIndex, pageSize int, out interface{}) (int, error) + func WrapPageQuery(ctx context.Context, db *gorm.DB, pp *schema.PaginationParam, out interface{}) (*schema.PaginationResult, error) + type Demo struct + func NewDemo(db *gorm.DB) *Demo + func (a *Demo) Create(ctx context.Context, item schema.Demo) error + func (a *Demo) Delete(ctx context.Context, recordID string) error + func (a *Demo) Get(ctx context.Context, recordID string, opts ...schema.DemoQueryOptions) (*schema.Demo, error) + func (a *Demo) Query(ctx context.Context, params schema.DemoQueryParam, ...) (*schema.DemoQueryResult, error) + func (a *Demo) Update(ctx context.Context, recordID string, item schema.Demo) error + func (a *Demo) UpdateStatus(ctx context.Context, recordID string, status int) error + type Menu struct + func NewMenu(db *gorm.DB) *Menu + func (a *Menu) Create(ctx context.Context, item schema.Menu) error + func (a *Menu) Delete(ctx context.Context, recordID string) error + func (a *Menu) Get(ctx context.Context, recordID string, opts ...schema.MenuQueryOptions) (*schema.Menu, error) + func (a *Menu) Query(ctx context.Context, params schema.MenuQueryParam, ...) (*schema.MenuQueryResult, error) + func (a *Menu) Update(ctx context.Context, recordID string, item schema.Menu) error + func (a *Menu) UpdateParentPath(ctx context.Context, recordID, parentPath string) error + type Role struct + func NewRole(db *gorm.DB) *Role + func (a *Role) Create(ctx context.Context, item schema.Role) error + func (a *Role) Delete(ctx context.Context, recordID string) error + func (a *Role) Get(ctx context.Context, recordID string, opts ...schema.RoleQueryOptions) (*schema.Role, error) + func (a *Role) Query(ctx context.Context, params schema.RoleQueryParam, ...) (*schema.RoleQueryResult, error) + func (a *Role) Update(ctx context.Context, recordID string, item schema.Role) error + type Trans struct + func NewTrans(db *gorm.DB) *Trans + func (a *Trans) Begin(ctx context.Context) (interface{}, error) + func (a *Trans) Commit(ctx context.Context, trans interface{}) error + func (a *Trans) Rollback(ctx context.Context, trans interface{}) error + type TransFunc func(context.Context) error + type User struct + func NewUser(db *gorm.DB) *User + func (a *User) Create(ctx context.Context, item schema.User) error + func (a *User) Delete(ctx context.Context, recordID string) error + func (a *User) Get(ctx context.Context, recordID string, opts ...schema.UserQueryOptions) (*schema.User, error) + func (a *User) Query(ctx context.Context, params schema.UserQueryParam, ...) (*schema.UserQueryResult, error) + func (a *User) Update(ctx context.Context, recordID string, item schema.User) error + func (a *User) UpdatePassword(ctx context.Context, recordID, password string) error + func (a *User) UpdateStatus(ctx context.Context, recordID string, status int) error