repo

package
v0.0.0-...-6bb929a Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

UserRepoProvider

Functions

This section is empty.

Types

type IUserRepo

type IUserRepo interface {
	Count(ctx context.Context, where entity.UserEntity) (total int64, err error)
	Find(ctx context.Context, where entity.UserEntity, order []string) (
		result *entity.UserEntity, err error)
	FindAll(ctx context.Context, where entity.UserEntity,
		order []string, opt ...int) (result []entity.UserEntity, err error)
	Insert(ctx context.Context,
		entity *entity.UserEntity) (int64, error)
	Update(ctx context.Context, where entity.UserEntity,
		update entity.UserEntity) (int64, error)
	Delete(ctx context.Context,
		where entity.UserEntity) (int64, error)
	PDelete(ctx context.Context,
		where entity.UserEntity) (int64, error)
	SelectPage(ctx context.Context, query *gplus.QueryCond[entity.UserEntity],
		limit, offset int) (*gplus.Page[entity.UserEntity], error)
}

IUserRepo

type UserRepo

type UserRepo struct {
	gplus.Dao[entity.UserEntity]
	// contains filtered or unexported fields
}

UserRepo

func NewUserRepo

func NewUserRepo(

	orm *gorm.DB,

) (*UserRepo, error)

NewUserRepo

func (*UserRepo) Count

func (p *UserRepo) Count(ctx context.Context, where entity.UserEntity) (total int64, err error)

Count

func (*UserRepo) Delete

func (p *UserRepo) Delete(ctx context.Context,
	where entity.UserEntity) (int64, error)

Delete * 注意:

  • where条件仅可以使用非零值

func (*UserRepo) Find

func (p *UserRepo) Find(ctx context.Context, where entity.UserEntity, order []string) (
	result *entity.UserEntity, err error)

Find * 注意:

  • where条件仅可以使用非零值
  • order的字段名需要同数据库字段名一致

func (*UserRepo) FindAll

func (p *UserRepo) FindAll(ctx context.Context, where entity.UserEntity,
	order []string, opt ...int) (result []entity.UserEntity, err error)

FindAll * 注意:

  • where条件仅可以使用非零值
  • order的字段名需要同数据库字段名一致

func (*UserRepo) Insert

func (p *UserRepo) Insert(ctx context.Context,
	entity *entity.UserEntity) (int64, error)

Insert

func (*UserRepo) PDelete

func (p *UserRepo) PDelete(ctx context.Context,
	where entity.UserEntity) (int64, error)

PDelete physical deletion * 注意:

  • where条件仅可以使用非零值

func (*UserRepo) SelectPage

func (p *UserRepo) SelectPage(ctx context.Context, query *gplus.QueryCond[entity.UserEntity],
	offset, limit int) (*gplus.Page[entity.UserEntity], error)

func (*UserRepo) Update

func (p *UserRepo) Update(ctx context.Context, where entity.UserEntity,
	update entity.UserEntity) (int64, error)

Update * 注意:

  • where、update仅可以使用非零值

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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